pub struct NodeSpec {
pub content: Option<HashSet<String>>,
pub marks: Option<HashSet<String>>,
pub attrs: Option<HashSet<String>>,
pub required_attrs: HashSet<String>,
}Expand description
Rules for one node type.
Fields§
§content: Option<HashSet<String>>Allowed child node types. None = any child type allowed.
marks: Option<HashSet<String>>Allowed mark types on this node. None = any mark allowed.
attrs: Option<HashSet<String>>Allowed attribute keys. None = any attrs allowed.
required_attrs: HashSet<String>Attribute keys that must be present.
Implementations§
Source§impl NodeSpec
impl NodeSpec
Sourcepub fn required_attrs<I, S>(self, keys: I) -> Self
pub fn required_attrs<I, S>(self, keys: I) -> Self
Set attribute keys that must be present.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeSpec
impl<'de> Deserialize<'de> for NodeSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for NodeSpec
Auto Trait Implementations§
impl Freeze for NodeSpec
impl RefUnwindSafe for NodeSpec
impl Send for NodeSpec
impl Sync for NodeSpec
impl Unpin for NodeSpec
impl UnsafeUnpin for NodeSpec
impl UnwindSafe for NodeSpec
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