pub struct Node {
pub id: Box<str>,
pub type: String,
pub attrs: Attrs,
pub content: GenericVector<Box<str>, ArcK>,
pub marks: GenericVector<Mark, ArcK>,
}
Expand description
Fields§
§id: Box<str>
§type: String
§attrs: Attrs
§content: GenericVector<Box<str>, ArcK>
§marks: GenericVector<Mark, ArcK>
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(
id: &str,
type: String,
attrs: Attrs,
content: Vec<Box<str>>,
marks: Vec<Mark>,
) -> Node
pub fn new( id: &str, type: String, attrs: Attrs, content: Vec<Box<str>>, marks: Vec<Mark>, ) -> Node
Sourcepub fn child_count(&self) -> usize
pub fn child_count(&self) -> usize
Sourcepub fn update_attr(
&self,
new_values: GenericHashMap<String, Value, RandomState, ArcK>,
) -> Node
pub fn update_attr( &self, new_values: GenericHashMap<String, Value, RandomState, ArcK>, ) -> Node
Sourcepub fn insert_content_at_index(&self, index: usize, node_id: &str) -> Node
pub fn insert_content_at_index(&self, index: usize, node_id: &str) -> Node
Sourcepub fn insert_content(&self, node_id: &str) -> Node
pub fn insert_content(&self, node_id: &str) -> Node
Sourcepub fn remove_mark_by_name(&self, mark_name: &str) -> Node
pub fn remove_mark_by_name(&self, mark_name: &str) -> Node
Sourcepub fn remove_mark(&self, mark_types: &[String]) -> Node
pub fn remove_mark(&self, mark_types: &[String]) -> Node
Trait Implementations§
Source§impl<'a> Add<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 + 运算符,用于添加单个节点
当使用 + 运算符时,会将新节点添加到当前节点的子节点列表中
impl<'a> Add<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 + 运算符,用于添加单个节点 当使用 + 运算符时,会将新节点添加到当前节点的子节点列表中
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Node, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Node, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Node
impl Serialize for Node
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<'a> Shl<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 << 运算符,用于在子节点列表开头插入单个节点
当使用 << 运算符时,会将新节点插入到当前节点的子节点列表的开头位置
impl<'a> Shl<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 << 运算符,用于在子节点列表开头插入单个节点 当使用 << 运算符时,会将新节点插入到当前节点的子节点列表的开头位置
Source§impl<'a> Shr<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 >> 运算符,用于在子节点列表末尾添加单个节点
当使用 >> 运算符时,会将新节点添加到当前节点的子节点列表的末尾位置
impl<'a> Shr<Node> for NodeRef<'a>
为 NodeRef 实现自定义的 >> 运算符,用于在子节点列表末尾添加单个节点 当使用 >> 运算符时,会将新节点添加到当前节点的子节点列表的末尾位置
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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