Extensible Data Notation in Cirru
Dependencies
Experimental port from cirru-edn.rs .
moon install tiye/cirru-edn"import": [{ "path": "tiye/cirru-edn", "alias": "edn" }],using @edn {type Edn}
match (try! Edn::parse(demo)) {
Ok(x) => {
println(x.to_string())
println(x.format?(use_inline=false).unwrap())
}
Err(e) => println("error:" + e.to_string())
}let parsed : Edn = try! @strconv.from_str("atom 1")
parsed.format?(use_inline=false).unwrap() // "atom 1"pub(all) suberror EdnCommonError {
EdnCommonError(String)
}impl Eq for EdnCommonErrorimpl Hash for EdnCommonErrorimpl Show for EdnCommonErrorpub(all) enum Edn {
Nil
Bool(Bool)
Number(Double)
Symbol(String)
Tag(EdnTag)
Str(String)
Quote(Cirru)
Tuple(EdnTupleView)
List(EdnListView)
Set(EdnSetView)
Map(EdnMapView)
Record(EdnRecordView)
Buffer(EdnBufferView)
Atom(Edn)
}type EdnListViewimpl Eq for EdnListViewtype EdnMapViewimpl Eq for EdnRecordViewimpl Show for EdnRecordViewimpl Compare for EdnSetViewimpl Eq for EdnSetViewimpl Hash for EdnSetView#deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
fn EdnSetView::inner(self : EdnSetView) -> HashSet[Edn]pub type EdnTag Stringimpl Compare for EdnTupleViewimpl Eq for EdnTupleViewimpl Hash for EdnTupleViewimpl Show for EdnTupleView