pub struct Node<'a> { /* private fields */ }Available on crate feature
unstable only.Implementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
pub fn new(id: u32, chunk: Chunk<'a>, doc: Weak<Document<'a>>) -> Self
pub fn id(&self) -> u32
pub fn doc(&self) -> Rc<Document<'a>>
Sourcepub fn chunk<'b>(self: &'b Rc<Node<'a>>) -> &'b RefCell<Chunk<'a>>
pub fn chunk<'b>(self: &'b Rc<Node<'a>>) -> &'b RefCell<Chunk<'a>>
Returns the chunk of this node.
Sourcepub fn prev_sibling(&self) -> Option<Rc<Self>>
pub fn prev_sibling(&self) -> Option<Rc<Self>>
Returns the previous sibling of this node.
Sourcepub fn next_sibling(&self) -> Option<Rc<Self>>
pub fn next_sibling(&self) -> Option<Rc<Self>>
Returns the next sibling of this node.
Sourcepub fn first_child(&self) -> Option<Rc<Self>>
pub fn first_child(&self) -> Option<Rc<Self>>
Returns the first child of this node.
Sourcepub fn last_child(&self) -> Option<Rc<Self>>
pub fn last_child(&self) -> Option<Rc<Self>>
Returns the last child of this node.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Returns true if this node has children.
Sourcepub fn insert_before(&self, value: Chunk<'a>) -> Rc<Node<'a>>
pub fn insert_before(&self, value: Chunk<'a>) -> Rc<Node<'a>>
Sourcepub fn insert_after(&self, value: Chunk<'a>) -> Rc<Node<'a>>
pub fn insert_after(&self, value: Chunk<'a>) -> Rc<Node<'a>>
Sourcepub fn prepend_id(&self, new_child_id: u32) -> Rc<Node<'a>>
pub fn prepend_id(&self, new_child_id: u32) -> Rc<Node<'a>>
Prepends a child to this node.
Sourcepub fn insert_id_before(&self, new_sibling_id: u32) -> Rc<Node<'a>>
pub fn insert_id_before(&self, new_sibling_id: u32) -> Rc<Node<'a>>
Inserts a sibling before this node.
§Panics
- Panics if
new_sibling_idis not valid. - Panics if this node is an orphan.
Sourcepub fn insert_id_after(&self, new_sibling_id: u32) -> Rc<Node<'a>>
pub fn insert_id_after(&self, new_sibling_id: u32) -> Rc<Node<'a>>
Inserts a sibling after this node.
§Panics
- Panics if
new_sibling_idis not valid. - Panics if this node is an orphan.
pub fn strip_styles(&self)
pub fn word_len(&self, len: &mut usize)
Trait Implementations§
impl<'a> Eq for Node<'a>
Auto Trait Implementations§
impl<'a> !Freeze for Node<'a>
impl<'a> !RefUnwindSafe for Node<'a>
impl<'a> !Send for Node<'a>
impl<'a> !Sync for Node<'a>
impl<'a> !UnwindSafe for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> UnsafeUnpin for Node<'a>
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,
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