pub struct NonRootNode {
pub value: String,
pub children: Vec<Box<NonRootNode>>,
pub collapse_state: CollapseState,
}
Fields§
§value: String
§children: Vec<Box<NonRootNode>>
§collapse_state: CollapseState
Implementations§
Source§impl NonRootNode
impl NonRootNode
pub fn leaf(value: String, collapse_state: CollapseState) -> Self
pub fn internal( value: String, children: Vec<NonRootNode>, collapse_state: CollapseState, ) -> Self
Sourcepub fn parse(
text: &str,
top_level_indentation: usize,
) -> Result<Self, ParseError>
pub fn parse( text: &str, top_level_indentation: usize, ) -> Result<Self, ParseError>
Parses one list item, i.e. a non-root node.
This assumes the initial “- “ for this item has already been stripped. Optional [ ] or [x] should still be present at top level. Top-level indentation means actual content (after “- “) starts in this column.
pub fn toggle(&mut self, identifier: TreeIdentifierVec)
Trait Implementations§
Source§impl Clone for NonRootNode
impl Clone for NonRootNode
Source§fn clone(&self) -> NonRootNode
fn clone(&self) -> NonRootNode
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NonRootNode
impl Debug for NonRootNode
Source§impl PartialEq for NonRootNode
impl PartialEq for NonRootNode
impl Eq for NonRootNode
impl StructuralPartialEq for NonRootNode
Auto Trait Implementations§
impl Freeze for NonRootNode
impl RefUnwindSafe for NonRootNode
impl Send for NonRootNode
impl Sync for NonRootNode
impl Unpin for NonRootNode
impl UnwindSafe for NonRootNode
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