pub struct NodeRef<'a> { /* private fields */ }Implementations§
Methods from Deref<Target = Tree>§
pub fn get_shard_index(&self, id: &NodeId) -> usize
pub fn contains_node(&self, id: &NodeId) -> bool
pub fn get_node(&self, id: &NodeId) -> Option<Arc<Node>>
pub fn get_parent_node(&self, id: &NodeId) -> Option<Arc<Node>>
pub fn update_attr( &mut self, id: &NodeId, new_values: HashMap<String, Value>, ) -> Result<(), PoolError>
pub fn add_node( &mut self, parent_id: &NodeId, nodes: &Vec<Node>, ) -> Result<(), PoolError>
pub fn node(&mut self, key: &str) -> NodeRef<'_>
pub fn mark(&mut self, key: &str) -> MarkRef<'_>
pub fn attrs(&mut self, key: &str) -> AttrsRef<'_>
pub fn children(&self, parent_id: &NodeId) -> Option<Vector<NodeId>>
pub fn children_node(&self, parent_id: &NodeId) -> Option<Vector<Arc<Node>>>
pub fn children_count(&self, parent_id: &NodeId) -> usize
pub fn remove_mark(&mut self, id: &NodeId, mark: Mark) -> Result<(), PoolError>
pub fn add_mark( &mut self, id: &NodeId, marks: &Vec<Mark>, ) -> Result<(), PoolError>
pub fn replace_node( &mut self, node_id: NodeId, nodes: &Vec<Node>, ) -> Result<(), PoolError>
pub fn move_node( &mut self, source_parent_id: &NodeId, target_parent_id: &NodeId, node_id: &NodeId, position: Option<usize>, ) -> Result<(), PoolError>
pub fn remove_node( &mut self, parent_id: &NodeId, nodes: Vec<NodeId>, ) -> Result<(), PoolError>
Trait Implementations§
Source§impl<'a> Add<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 + 运算符,用于添加单个节点
当使用 + 运算符时,会将新节点添加到当前节点的子节点列表中
impl<'a> Add<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 + 运算符,用于添加单个节点 当使用 + 运算符时,会将新节点添加到当前节点的子节点列表中
Source§impl<'a> Add<Vec<Node>> for NodeRef<'a>
为 NodeRef 实现自定义的 + 运算符,用于添加多个节点
当使用 + 运算符时,会将多个新节点添加到当前节点的子节点列表中
impl<'a> Add<Vec<Node>> for NodeRef<'a>
为 NodeRef 实现自定义的 + 运算符,用于添加多个节点 当使用 + 运算符时,会将多个新节点添加到当前节点的子节点列表中
Source§impl<'a> Sub<String> for NodeRef<'a>
为 NodeRef 实现自定义的 - 运算符,用于删除单个节点
当使用 - 运算符时,会从当前节点的子节点列表中移除指定的节点
impl<'a> Sub<String> for NodeRef<'a>
为 NodeRef 实现自定义的 - 运算符,用于删除单个节点 当使用 - 运算符时,会从当前节点的子节点列表中移除指定的节点
Auto Trait Implementations§
impl<'a> Freeze for NodeRef<'a>
impl<'a> RefUnwindSafe for NodeRef<'a>
impl<'a> Send for NodeRef<'a>
impl<'a> Sync for NodeRef<'a>
impl<'a> Unpin for NodeRef<'a>
impl<'a> !UnwindSafe for NodeRef<'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> 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