Skip to main content

Checkpointed

Struct Checkpointed 

Source
pub struct Checkpointed {
    pub inner: ErasedHandler,
    pub workspace: Arc<dyn Workspace>,
    pub root: PathBuf,
    pub taking: Taking,
    pub newest: Arc<Mutex<Option<Snapshot>>>,
    pub first: Arc<Mutex<Option<Snapshot>>>,
    pub before: Arc<Mutex<Option<Snapshot>>>,
}
Expand description

A handler that takes a Snapshot just before and just after its inner handler serves a call, and publishes what changed as FilesChanged beside the call’s answer, unless the call published its own: so a call of any tool that may write anything, such as shell, reports what it changed.

What it reports is what changed while the call ran, by whatever wrote it: a process outside the call that wrote in that time, such as the user’s editor, is in it. A change made between two calls is in neither.

newest, shared between the calls one host checkpoints with the same root, is the newest snapshot any of them took: each call hands it to snapshot as earlier, so a scan hashes again only what changed and git’s private index stays warm, but never takes it as its “before”. first, shared the same way, keeps the first “before” taken, the files as they were before the first of those calls, so the host can tell what all of them changed or restore a file. before, this call’s own, keeps the snapshot taken just before it ran, so the host can tell what it alone changed later on or read a file as it found it. Snapshots run on a thread of their own; one that fails is logged, and the call publishes nothing. A call that streams its answer is served as it is, with nothing published.

Fields§

§inner: ErasedHandler

The handler that serves the call.

§workspace: Arc<dyn Workspace>

Where the files are.

§root: PathBuf

The directory whose files are compared.

§taking: Taking

How each snapshot is taken.

§newest: Arc<Mutex<Option<Snapshot>>>

The newest snapshot taken by any call it shares this with: only reused as earlier, never as a “before”.

§first: Arc<Mutex<Option<Snapshot>>>

The snapshot before the first call, once one was taken.

§before: Arc<Mutex<Option<Snapshot>>>

The snapshot taken just before this call ran, once taken.

Trait Implementations§

Source§

impl Clone for Checkpointed

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Checkpointed

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serve for Checkpointed

Source§

type Family = Dynamic

The family this handler serves, or Dynamic.
Source§

fn descriptor(&self) -> HandlerDescriptor

What this handler is: the family-keyed description a typed view checks at bind time and a scene serializes.
Source§

fn key(&self) -> HandlerKey

The descriptor’s key. A handler whose descriptor is costly to build, such as a tool’s argument schema, says it without building one.
Source§

async fn serve(&self, kind: EffectKind, dispatch: Dispatch) -> Reply

Prepare an outcome or an owned stream for the driver to consume.
Source§

fn footprint(&self, kind: &EffectKind) -> Option<Touches>

What dispatching kind may read and change, for a tool’s handler (Tool::footprint); None when it cannot say, such as for arguments that do not parse.
Source§

fn check(&self, kind: &EffectKind) -> Vec<UnsupportedOption>

The options of kind this handler would leave out when it serves it, with nothing sent: for a model’s handler, what its wire or model cannot honour (DynModel::check). Empty when it leaves nothing out or cannot say, as by default.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more