pub struct Rules {
pub nodes: HashMap<String, NodeRule>,
pub marks: HashMap<String, MarkRule>,
}Fields§
§nodes: HashMap<String, NodeRule>§marks: HashMap<String, MarkRule>Implementations§
Source§impl Rules
impl Rules
pub fn empty() -> Self
Sourcepub fn parse(json: &str) -> Result<Rules, String>
pub fn parse(json: &str) -> Result<Rules, String>
Parse the rules JSON (however the caller compiled it). Absent keys
take their defaults (void/callback false, content inline), so a
typical document looks like:
{ "nodes": { "callout": { "tag": "aside",
"attrs": [["class", [{"lit": "callout"}]],
["data-kind", [{"ref": "kind"}]]],
"content": "blocks" },
"video": { "callback": true } },
"marks": { "comment": { "tag": "span",
"attrs": [["data-id", [{"ref": "id"}]]] } } }Auto Trait Implementations§
impl Freeze for Rules
impl RefUnwindSafe for Rules
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl UnsafeUnpin for Rules
impl UnwindSafe for Rules
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more