pub enum NodeOwnership {
TreeOwned,
CallerOwned,
Borrowed,
Unlinked,
}Expand description
The ownership state of a tree node.
This is used internally to track whether a node pointer is:
- Part of a document tree (owned by the document)
- A standalone node (caller-owned, must be freed or adopted)
- A borrowed reference (must not be freed)
Variants§
TreeOwned
The node is owned by its parent document or parent node. It will be freed when the document is freed. Callers must NOT free it directly.
CallerOwned
The node is standalone (not attached to any document). The caller owns it and must free it or attach it to a tree.
Borrowed
The node is borrowed from a tree. The caller must NOT free it.
Unlinked
The node has been unlinked from its tree. The caller now owns it and must free it or re-attach it.
Trait Implementations§
Source§impl Clone for NodeOwnership
impl Clone for NodeOwnership
Source§fn clone(&self) -> NodeOwnership
fn clone(&self) -> NodeOwnership
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NodeOwnership
Source§impl Debug for NodeOwnership
impl Debug for NodeOwnership
impl Eq for NodeOwnership
Source§impl PartialEq for NodeOwnership
impl PartialEq for NodeOwnership
impl StructuralPartialEq for NodeOwnership
Auto Trait Implementations§
impl Freeze for NodeOwnership
impl RefUnwindSafe for NodeOwnership
impl Send for NodeOwnership
impl Sync for NodeOwnership
impl Unpin for NodeOwnership
impl UnsafeUnpin for NodeOwnership
impl UnwindSafe for NodeOwnership
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