deriving JSON serialization and deserialization automatically
pub(open) trait Decode { decode(Json, Path) -> Self raise DecodeError}
impl Decode for Bool
fn decode(self : Json, path : Path) -> Bool raise DecodeError
impl Decode for Int
fn decode(self : Json, path : Path) -> Int raise DecodeError
impl Decode for Int16
fn decode(self : Json, path : Path) -> Int16 raise DecodeError
impl Decode for Int64
fn decode(self : Json, path : Path) -> Int64 raise DecodeError
impl Decode for UInt
fn decode(self : Json, path : Path) -> UInt raise DecodeError
impl Decode for UInt64
fn decode(self : Json, path : Path) -> UInt64 raise DecodeError
impl Decode for Float
fn decode(self : Json, path : Path) -> Float raise DecodeError
impl Decode for Double
fn decode(self : Json, path : Path) -> Double raise DecodeError
impl Decode for String
fn decode(self : Json, path : Path) -> String raise DecodeError
impl Decode for Option[T]
fn[T : Decode] decode(self : Json, path : Path) -> T? raise DecodeError
impl Decode for Result[T, E]
fn[T : Decode, E : Decode] decode(self : Json, path : Path) -> Result[T, E] raise DecodeError
impl Decode for Array[T]
fn[T : Decode] decode(self : Json, path : Path) -> Array[T] raise DecodeError
pub(open) trait Encode { #as_free_fn encode(Self) -> Json}
impl Encode for Bool
fn encode(self : Bool) -> Json
impl Encode for Int
fn encode(self : Int) -> Json
impl Encode for Int16
fn encode(self : Int16) -> Json
impl Encode for Int64
fn encode(self : Int64) -> Json
impl Encode for UInt
fn encode(self : UInt) -> Json
impl Encode for UInt64
fn encode(self : UInt64) -> Json
impl Encode for Float
fn encode(self : Float) -> Json
impl Encode for Double
fn encode(self : Double) -> Json
impl Encode for String
fn encode(self : String) -> Json
impl Encode for Option[T]
fn[T : Encode] encode(self : T?) -> Json
impl Encode for Result[T, E]
fn[T : Encode, E : Encode] encode(self : Result[T, E]) -> Json
impl Encode for Array[T]
fn[T : Encode] encode(self : Array[T]) -> Json
pub suberror DecodeError (Path, Json)
impl Show for DecodeError
fn output(self : DecodeError, buf : &Logger) -> Unit
pub(all) enum Path { Root Key(Path, String) Index(Path, Int)}
impl Eq for Path
fn equal(Path, Path) -> Bool
impl Show for Path
fn output(self : Path, buf : &Logger) -> Unit
fn[T : Decode] decode(json : Json, path? : Path) -> T raise DecodeError
fn[T] fail(path : Path, json : Json) -> T raise DecodeError
Install
Powered by MoonBit
© 2026 mooncakes.io