pub struct MutBlock {
pub id: String,
pub kind: String,
pub raw: String,
pub trivia: String,
pub attrs: Map<String, Value>,
pub children: Vec<MutBlock>,
pub dirty: bool,
}Expand description
A block of the working tree (§1 MutBlock).
Fields§
§id: String§kind: StringThe spec/format §3 kind name (blocks.type).
raw: StringThe raw blob’s bytes.
trivia: StringThe trivia blob’s bytes, or "" when trivia_hash was NULL.
attrs: Map<String, Value>The block’s attrs as stored (a JSON object).
children: Vec<MutBlock>§dirty: boolThe render flag (§3): false when loaded; set by the ops whose
children changed.
Implementations§
Source§impl MutBlock
impl MutBlock
Sourcepub fn new(id: &str, kind: &str, raw: &str, trivia: &str) -> MutBlock
pub fn new(id: &str, kind: &str, raw: &str, trivia: &str) -> MutBlock
A childless, clean block with empty attrs.
Sourcepub fn iter(&self) -> impl Iterator<Item = &MutBlock>
pub fn iter(&self) -> impl Iterator<Item = &MutBlock>
This block and every descendant, pre-order.
Sourcepub fn has_dirty_descendant(&self) -> bool
pub fn has_dirty_descendant(&self) -> bool
Whether this block or any descendant is dirty (§3).
Sourcepub fn mark_subtree_clean(&mut self)
pub fn mark_subtree_clean(&mut self)
Mark this block and its whole subtree clean.
Sourcepub fn subtree_ids(&self) -> Vec<String>
pub fn subtree_ids(&self) -> Vec<String>
The ids of this block and every descendant, pre-order.
Trait Implementations§
impl StructuralPartialEq for MutBlock
Auto Trait Implementations§
impl Freeze for MutBlock
impl RefUnwindSafe for MutBlock
impl Send for MutBlock
impl Sync for MutBlock
impl Unpin for MutBlock
impl UnsafeUnpin for MutBlock
impl UnwindSafe for MutBlock
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