pub enum OpCodes {
Document(TitleBlockUpdate),
Block(BlockId, Crud<Block, BlockUpdate>),
Pin(PinId, Crud<Pin, PinUpdate>),
Route(RouteId, Crud<Route, RouteUpdate>),
RouteLabel(RouteLabelId, Crud<RouteLabel, RouteLabelUpdate>),
Text(TextId, Crud<Text, TextUpdate>),
Area(AreaId, Crud<Area, AreaUpdate>),
Image(ImageId, Crud<Image, ImageUpdate>),
Asset(AssetHash, Asset),
}Variants§
Document(TitleBlockUpdate)
Singleton: no id, no lifecycle — update only.
Block(BlockId, Crud<Block, BlockUpdate>)
Pin(PinId, Crud<Pin, PinUpdate>)
Route(RouteId, Crud<Route, RouteUpdate>)
RouteLabel(RouteLabelId, Crud<RouteLabel, RouteLabelUpdate>)
Text(TextId, Crud<Text, TextUpdate>)
Area(AreaId, Crud<Area, AreaUpdate>)
Image(ImageId, Crud<Image, ImageUpdate>)
Asset(AssetHash, Asset)
A payload under its own content hash. Deliberately not a Crud:
an asset has no registers to update and no lifecycle to set — it
either exists or is unreferenced, and reclaiming the unreferenced
belongs to compaction, not to an edit. Create-only makes duplicate
delivery and replay structural no-ops, since one hash can only ever
name one byte string.
Implementations§
Source§impl OpCodes
impl OpCodes
Sourcepub fn narrate(&self) -> String
pub fn narrate(&self) -> String
The op named without its payload: kind, target, lifecycle. The editor’s mutation log narrates with this — a trace wants to know which entity changed and how, never what the user typed or which bytes an asset carries.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OpCodes
impl<'de> Deserialize<'de> for OpCodes
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
impl StructuralPartialEq for OpCodes
Auto Trait Implementations§
impl Freeze for OpCodes
impl RefUnwindSafe for OpCodes
impl Send for OpCodes
impl Sync for OpCodes
impl Unpin for OpCodes
impl UnsafeUnpin for OpCodes
impl UnwindSafe for OpCodes
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