pub struct Taker<'a> {
pub machine: &'a str,
pub store: &'a Store,
pub ring: &'a KeyRing,
pub key: &'a Key,
pub profiles: &'a dyn Profiles,
}Expand description
This machine’s side of the sync layer for the Vault: its store, the Vault’s keys, this machine’s own key, and its profiles.
Fields§
§machine: &'a strThis machine’s id in the layer (the origin of its own records): the machine a version of its own is “changed on”.
store: &'a Store§ring: &'a KeyRing§key: &'a KeyThis machine’s own key, which seals the values it keeps.
profiles: &'a dyn ProfilesImplementations§
Source§impl Taker<'_>
impl Taker<'_>
Sourcepub fn receive(
&self,
rec: &Record,
pins: &Pins,
clock: &mut Clock,
now_ms: i64,
) -> Result<Taken, String>
pub fn receive( &self, rec: &Record, pins: &Pins, clock: &mut Clock, now_ms: i64, ) -> Result<Taken, String>
Hands rec to the layer, and takes its result into the store. An error from the layer (a record that is refused, out of
sequence or at another epoch) comes back as text and the log does not hold the record. An error from the store, or a
record the store cannot take yet (Effect::Deferred), comes back after the log holds the record, which the layer does
not hand over again: so it is noted, and Taker::retake takes it again from the log.
Sourcepub fn retake(
&self,
vault: &str,
now_ms: i64,
) -> Result<Vec<(String, Result<Effect, String>)>, String>
pub fn retake( &self, vault: &str, now_ms: i64, ) -> Result<Vec<(String, Result<Effect, String>)>, String>
Takes again the records of vault that the log holds and the store did not take (an error, a key not here yet, a kind
this version does not know), from the log’s current state of each, as a plain change that follows on: the side of a
conflict that lost stays in the log. A record taken, or no longer in the log, is not noted any more; one that fails again
stays, with the conflict it won (so does one that finds the entry changed here since it was read, which is never written over). Run it after a
capture, at the start of a sync round, and after an upgrade: a change made here is in the log by then.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Taker<'a>
impl<'a> !Send for Taker<'a>
impl<'a> !Sync for Taker<'a>
impl<'a> !UnwindSafe for Taker<'a>
impl<'a> Freeze for Taker<'a>
impl<'a> Unpin for Taker<'a>
impl<'a> UnsafeUnpin for Taker<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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