pub struct Node {
pub id: NodeId,
pub label: String,
pub kind: NodeKind,
pub language: Option<String>,
pub span: Option<SourceSpan>,
pub attributes: BTreeMap<String, AttributeValue>,
}Fields§
§id: NodeId§label: String§kind: NodeKind§language: Option<String>§span: Option<SourceSpan>§attributes: BTreeMap<String, AttributeValue>Implementations§
Source§impl Node
impl Node
Sourcepub fn new(
id: impl Into<String>,
label: impl Into<String>,
kind: NodeKind,
) -> Result<Self>
pub fn new( id: impl Into<String>, label: impl Into<String>, kind: NodeKind, ) -> Result<Self>
pub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_span(self, span: SourceSpan) -> Self
pub fn with_attribute( self, key: impl Into<String>, value: impl Into<AttributeValue>, ) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
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 Eq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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