pub struct Node {
pub key: Option<String>,
pub kind: Kind,
}Expand description
One node of a view tree.
Fields§
§key: Option<String>Any string unique in the tree: patches address the node by it, and clients keep its state (typed text, scroll, selection) under it across replies.
kind: KindImplementations§
Source§impl Node
impl Node
pub fn new(kind: Kind) -> Self
pub fn keyed(key: impl Into<String>, kind: Kind) -> Self
pub fn children(&self) -> &[Node]
pub fn children_mut(&mut self) -> Option<&mut Vec<Node>>
Sourcepub fn fallback_markdown(&self) -> String
pub fn fallback_markdown(&self) -> String
Markdown for a client that can’t draw trees: the texts, titles and tables, without the controls.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Decodes like decode, dropping the faults.
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