pub struct NodeSpec {
pub kind: NodeKind,
pub span: SourceSpan,
pub attributes: AttrMap,
}Expand description
Blueprint for allocating a node in the document arena.
Carries only caller-chosen fields: kind, span, and attributes.
The arena supplies the id, empty children, and identity/style
placeholders.
Fields§
§kind: NodeKind§span: SourceSpan§attributes: AttrMapImplementations§
Source§impl NodeSpec
impl NodeSpec
Sourcepub const fn new(kind: NodeKind, span: SourceSpan) -> Self
pub const fn new(kind: NodeKind, span: SourceSpan) -> Self
A spec for a node of kind spanning span, with no attributes.
Sourcepub fn with_attributes(self, attributes: AttrMap) -> Self
pub fn with_attributes(self, attributes: AttrMap) -> Self
Attach attributes to this spec.
Trait Implementations§
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