pub struct SerTree {
pub base: Option<String>,
pub nodes: Vec<SerNode>,
pub root: u32,
pub current: u32,
pub next_seq: u64,
}Expand description
Serializable projection of an [UndoTree] for the undofile and the swap
undo section. Postcard-encoded (non-self-describing, so a schema/version
drift surfaces as a parse Err that the reader discards). See
[UndoTree::to_serializable] / [UndoTree::from_serializable].
Fields§
§base: Option<String>Root base text (the anchor the delta chain replays from). Always
Some on write; from_serializable rejects None — a tree without an
anchor is structurally invalid outside the swap context. The swap
writer drops it for single-node trees (the body IS the base) and the
swap reader re-substitutes the body text before the tree is rebuilt.
nodes: Vec<SerNode>Dense node arena (no holes).
root: u32Root index into nodes.
current: u32Current (live) index into nodes.
next_seq: u64Next seq to assign.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SerTree
impl<'de> Deserialize<'de> for SerTree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SerTree
impl RefUnwindSafe for SerTree
impl Send for SerTree
impl Sync for SerTree
impl Unpin for SerTree
impl UnsafeUnpin for SerTree
impl UnwindSafe for SerTree
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