pub struct Node {
pub kind: String,
pub key: String,
pub props: BTreeMap<String, Value>,
pub binding: Option<Binding>,
pub events: BTreeMap<String, Event>,
pub anchor: Option<String>,
pub children: Vec<Node>,
}Expand description
A node of a view’s tree: a described component (ui.ListRow), a primitive of the language
(stack, row, list), a slot holding a component’s named slot, or a fragment.
Fields§
§kind: String§key: StringStable for as long as the node shows the same thing: widgets are kept by key.
props: BTreeMap<String, Value>§binding: Option<Binding>§events: BTreeMap<String, Event>What each event does, by the event’s name.
anchor: Option<String>The resource or part a link to this node names.
children: Vec<Node>Implementations§
Source§impl Node
impl Node
Sourcepub fn at(&self, path: &[String]) -> Option<&Self>
pub fn at(&self, path: &[String]) -> Option<&Self>
The node at path (keys from this node’s children down), if there is one.
Sourcepub fn find(&self, key: &str) -> Option<&Self>
pub fn find(&self, key: &str) -> Option<&Self>
The node whose key is key, anywhere under this one (this one included); the first
found, depth first.
Sourcepub fn of_kind(&self, kind: &str) -> Vec<&Self>
pub fn of_kind(&self, kind: &str) -> Vec<&Self>
Every node of kind under this one (this one included), in drawing order.
Sourcepub fn first_of_kind(&self, kind: &str) -> Option<&Self>
pub fn first_of_kind(&self, kind: &str) -> Option<&Self>
The first node of kind under this one (this one included), in drawing order.
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 StructuralPartialEq for Node
Auto Trait Implementations§
impl Forget for Node
impl Freeze for Node
impl Move 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more