Skip to main content

Target

Struct Target 

Source
pub struct Target { /* private fields */ }
Expand description

One process of a target’s role (§2.6–§2.10): the version it last acted on or adopted, the one it holds while an act runs, per run the highest seq it acted on or adopted (or the asof it reverted on), and its report. A new process is a new Target, holding nothing (§2.7). Its rules are desired.v1’s machine’s (machine::Core), read over runs and seqs.

Implementations§

Source§

impl Target

Source

pub fn new() -> Self

A role at its start: nothing held, its report the baseline’s. An unbound role’s is the same, and stays so (§2.12).

Source

pub fn report(&self) -> Report

The report, as the target puts it (§2.10). A revision above MAX_REVISION has no code, so its version is reported without one (§2.4).

Source

pub fn running(&self) -> Option<Act>

The act that runs, if one does.

Source

pub fn remembered(&self, run: Run) -> Option<Seq>

The highest seq this process acted on or adopted a version of under run, or the asof it reverted on, if it remembers the run (§2.6 step 4, §2.8).

Source

pub fn held(&self) -> Option<Version>

The stamp a conditional read sends (§2.5): that of the latest version the target admitted, the one it holds waiting, else the running act’s, else the last it acted on or adopted. None where it holds no version: nothing yet, or a snapshot with no entry it admitted last.

Source

pub fn holds(&self) -> Option<(Mutation, Version)>

Target::held, with whether that version is a put’s or a delete’s, as a Watch moves its digest by.

Source

pub fn observe(&mut self, s: Sample) -> Step

Judges a version (§2.6): against the one last acted on or adopted (the running act’s while one runs) and every run remembered, then, while an act runs, against what waits: an act to start, adopted, held while one runs, or ignored with why. After Step::Adopted and Step::Confirmed the report may have changed.

Source

pub fn observe_no_entry(&mut self, run: Run, asof: Seq) -> Step

Judges a snapshot with no entry (§2.8), its header’s run and its asof: it reverts only where the target holds a document’s version of that run with a seq at or below the asof. Under another run, over a delete or with nothing held it is no verdict, and a MUST NOT; built before the held version it is older. While an act runs it is judged against the running act’s version, then against what waits, and admitted by both it waits as a delete does.

Source

pub fn unchanged(&mut self, sent: Version) -> Step

A conditional read answered unchanged, by the held stamp sent (§2.5): the author’s own word of that version, which judges nothing and confirms a last-known one (§2.9). Step::Confirmed where the target holds sent from an archive, else Step::SameVersion.

Source

pub fn finish(&mut self, ended: Ended) -> Step

Ends the running act (§2.7, §2.10): the report updated, then what waits, if anything does, adopted or its act started, else Step::Done. With no act running, nothing changes.

Source

pub fn call(&mut self)

The target’s own operation changed what is in force (§2.7): source is call and in_force none. The rest stays.

Trait Implementations§

Source§

impl Clone for Target

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 Target

Source§

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

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

impl Default for Target

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Target

§

impl Freeze for Target
where *const u8 is !null: Freeze, PhantomData<(Run, Seq, bool)>: Freeze,

§

impl Move for Target

§

impl RefUnwindSafe for Target

§

impl Send for Target
where RawVecInner: Send, Run: Send, Seq: Send,

§

impl Sync for Target
where RawVecInner: Sync, Run: Sync, Seq: Sync,

§

impl Unpin for Target
where *const u8 is !null: Unpin, Run: Unpin, Seq: Unpin,

§

impl UnsafeUnpin for Target

§

impl UnwindSafe for Target
where RawVecInner: UnwindSafe, Run: UnwindSafe, Seq: UnwindSafe,

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> AsNode<T> for T

Source§

fn as_node(&self) -> &T

Source§

impl<T> AsNodeMut<T> for T

Source§

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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, 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.