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 Nodewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Node>: Freeze,
PhantomData<String>: Freeze,
PhantomData<TableColumn>: Freeze,
PhantomData<Vec<Value>>: Freeze,
PhantomData<ChartSeries>: Freeze,
PhantomData<Map<String, Value>>: Freeze,
*const ChartSource is !null: Freeze,
PhantomData<ChartSource>: Freeze,
PhantomData<Shape>: Freeze,
PhantomData<GridBlock>: Freeze,
*const LeafNode<u32, f32> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(u32, f32)>>: Freeze,
impl Move for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Nodewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Node>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<TableColumn>: UnsafeUnpin,
PhantomData<Vec<Value>>: UnsafeUnpin,
PhantomData<ChartSeries>: UnsafeUnpin,
PhantomData<Map<String, Value>>: UnsafeUnpin,
*const ChartSource is !null: UnsafeUnpin,
PhantomData<ChartSource>: UnsafeUnpin,
PhantomData<Shape>: UnsafeUnpin,
PhantomData<GridBlock>: UnsafeUnpin,
*const LeafNode<u32, f32> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(u32, f32)>>: UnsafeUnpin,
impl UnwindSafe for Nodewhere
RawVecInner: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BoxRaw<ChartSource>: UnwindSafe,
BTreeMap<u32, f32>: UnwindSafe,
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