Skip to main content

StructuredNode

Trait StructuredNode 

Source
pub trait StructuredNode<'a>: Sized {
    // Required methods
    fn kind(&self) -> Cow<'a, str>;
    fn attribute(&self, key: &str) -> Option<StructuredValue<'a>>;
    fn children(&self) -> Vec<Self>;
    fn value(&self) -> StructuredValue<'a>;

    // Provided methods
    fn identifier(&self) -> Option<Cow<'a, str>> { ... }
    fn attribute_str(&self, key: &str) -> Option<Cow<'a, str>> { ... }
    fn attribute_bool(&self, key: &str) -> Option<bool> { ... }
    fn type_annotation(&self) -> Option<Cow<'a, str>> { ... }
}

Required Methods§

Source

fn kind(&self) -> Cow<'a, str>

Source

fn attribute(&self, key: &str) -> Option<StructuredValue<'a>>

Source

fn children(&self) -> Vec<Self>

Source

fn value(&self) -> StructuredValue<'a>

Provided Methods§

Source

fn identifier(&self) -> Option<Cow<'a, str>>

Source

fn attribute_str(&self, key: &str) -> Option<Cow<'a, str>>

Source

fn attribute_bool(&self, key: &str) -> Option<bool>

Source

fn type_annotation(&self) -> Option<Cow<'a, str>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§