pub struct Gesture {
ops: CommitBuilder,
label: Label,
staged: Option<Staged>,
ids: Allocator,
writability: Writability,
}Expand description
The ops a gesture has authored, and the document they imply.
The prediction is why this is a type rather than a bare CommitBuilder.
The repo’s document only advances at submit, so a gesture reading it
would not see its own writes: a block placed and immediately renamed
would read as absent. Gesture::author is the only way in, and it folds
what the gesture has said so far onto the base — so the next read, in
this same frame, sees it.
Fields§
§ops: CommitBuilder§label: LabelWhat this gesture is called before it has authored anything — finished at the seal, where the ops say what it acted on.
staged: Option<Staged>The base with Self::ops folded on. None while the gesture has
authored nothing, because then the base already is the prediction —
an idle frame pays neither the fold nor the index rebuild.
ids: AllocatorThe ids this gesture has handed out, beside the document’s own
marks. A mint that never becomes a Create still raises this, so
two mints of one kind cannot collide inside a gesture; an abandoned
gesture takes its marks with it, which costs nothing because it
created nothing.
writability: WritabilityWhether the session behind this sink may write at all. Carried here
because this is the write door: a read-only session’s gesture
declines in Self::author, and the tools read the same answer
through Drawing::authoring
to decide what to offer in the first place.
Implementations§
Source§impl Gesture
impl Gesture
Sourcepub fn open(label: Label, writability: Writability) -> Self
pub fn open(label: Label, writability: Writability) -> Self
Open a gesture under its semantic label.
Sourcepub fn idle() -> Self
pub fn idle() -> Self
A gesture between gestures, and the sink a read pass is handed. Nothing writes into it — every write opens its own labelled one — so neither this label nor its writability reaches a commit.
pub fn writability(&self) -> Writability
pub fn ops(&self) -> &[OpCodes]
Sourcepub fn ids(&self, base: &Document) -> Allocator
pub fn ids(&self, base: &Document) -> Allocator
The allocator an emitter whose id count is data-dependent (paste) mints from: this gesture’s marks raised to the prediction’s, so nothing it has authored can be minted twice.
Sourcepub fn mint<K: IdKind>(&mut self, base: &Document) -> Id<K>
pub fn mint<K: IdKind>(&mut self, base: &Document) -> Id<K>
A fresh id for a setter that mints one.
Sourcefn prediction<'v>(&'v self, base: &'v Document) -> &'v Document
fn prediction<'v>(&'v self, base: &'v Document) -> &'v Document
The document as this gesture has left it: the base until it writes.
Sourcepub fn view<'v>(&'v self, base: IndexedDocument<'v>) -> IndexedDocument<'v>
pub fn view<'v>(&'v self, base: IndexedDocument<'v>) -> IndexedDocument<'v>
The document this gesture reads: base with its own writes folded
on. Identical to base until it writes.
The one write door. emit is handed the document as this gesture has
left it and the sink to author into; whatever it pushes advances the
prediction before the call returns, so no caller can read a document
that predates its own edit.
what names the edit for the mutation log (RUST_LOG=edit=debug),
which narrates here rather than at each setter: authoring without
narrating would mean calling this without an argument.
Crate-private on purpose: a gesture is authored into through a
Drawing method, never by the tool
holding it.
Auto Trait Implementations§
impl Freeze for Gesture
impl RefUnwindSafe for Gesture
impl Send for Gesture
impl Sync for Gesture
impl Unpin for Gesture
impl UnsafeUnpin for Gesture
impl UnwindSafe for Gesture
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more