pub struct Owner { /* private fields */ }Expand description
One config.v2 owner, as a pure state machine over
super::Owner, which runs config.v1’s rules unchanged with its
times rounded up to the second (super::Owner::whole_seconds).
It adds the wire (§2.3 to §2.17): it puts its record whenever a field of it changes, and only then; it answers every call with the record in the value form, or a refusal in the error form, under its as-of mark; it publishes each change’s event after the reply; it mints 48-bit tokens, a new run before the counter passes 65,535; and it replays an idempotent retry’s first answer byte for byte.
Implementations§
Source§impl Owner
impl Owner
Sourcepub fn start(
iface: Interface,
s: Start,
mint: &mut dyn Mint,
) -> Result<(Self, Output), StartError>
pub fn start( iface: Interface, s: Start, mint: &mut dyn Mint, ) -> Result<(Self, Output), StartError>
Starts an owner (§2.3): its instance number is the run mint
writes under, and its first put is its record, before its tokens.
§Errors
config.v1’s StartErrors, and a floor of 0.
Sourcepub fn restart(&self, mint: &mut dyn Mint) -> (Self, Output)
pub fn restart(&self, mint: &mut dyn Mint) -> (Self, Output)
The owner after a restart (§2.12): a new instance under the next
run mint takes, its startup values and persisted layer, nothing
pending, no key held.
Sourcepub fn restart_in(&self, mint: &mut dyn Mint) -> (Self, Output)
pub fn restart_in(&self, mint: &mut dyn Mint) -> (Self, Output)
Owner::restart in a new instance that took its run already, as a
re-mint does (v1 §2.12, “A re-mint is a restart”; core §1.5, §4.3):
its instance number is the run mint writes under now, under which
nothing was written yet.
Sourcepub fn restart_plan(&self) -> Result<Vec<Restore>, (String, String)>
pub fn restart_plan(&self) -> Result<Vec<Restore>, (String, String)>
What a re-mint returns the device to first (v1 §2.12, “A re-mint is
a restart”): config.v1’s super::Owner::restart_plan of the owner
this one runs.
§Errors
(group, parameter) of a parameter with a running value and no
startup value.
Sourcepub fn inner(&self) -> &Owner
pub fn inner(&self) -> &Owner
config.v1’s owner this one runs: its startup values, its due instants and its published events.
Sourcepub fn next_due(&self) -> Option<Time>
pub fn next_due(&self) -> Option<Time>
The next instant Owner::due has something to do.
Sourcepub fn set(
&mut self,
now: Time,
group: &str,
payload: &[u8],
call: &Call,
mint: &mut dyn Mint,
) -> Step
pub fn set( &mut self, now: Time, group: &str, payload: &[u8], call: &Call, mint: &mut dyn Mint, ) -> Step
A call to set/<group> (§2.5, §2.9): the parse, an act in flight,
a key held, then config.v1’s rows and its owner; answered now, or an
Act::Apply for a hot group, answered by Owner::finish. A
group with no set reaches no queryable: nothing answers.
Sourcepub fn confirm(
&mut self,
now: Time,
payload: &[u8],
call: &Call,
mint: &mut dyn Mint,
) -> Step
pub fn confirm( &mut self, now: Time, payload: &[u8], call: &Call, mint: &mut dyn Mint, ) -> Step
confirm (§2.10): answered now.
Sourcepub fn cancel(
&mut self,
now: Time,
payload: &[u8],
call: &Call,
mint: &mut dyn Mint,
) -> Step
pub fn cancel( &mut self, now: Time, payload: &[u8], call: &Call, mint: &mut dyn Mint, ) -> Step
cancel (§2.10): an Act::Undo when something of the change is
applied, else answered now.
Sourcepub fn extend(
&mut self,
now: Time,
payload: &[u8],
call: &Call,
mint: &mut dyn Mint,
) -> Step
pub fn extend( &mut self, now: Time, payload: &[u8], call: &Call, mint: &mut dyn Mint, ) -> Step
extend (§2.10): answered now, the deadline rounded up.
Sourcepub fn persist(
&mut self,
now: Time,
payload: &[u8],
mint: &mut dyn Mint,
) -> Result<PersistPlan, Output>
pub fn persist( &mut self, now: Time, payload: &[u8], mint: &mut dyn Mint, ) -> Result<PersistPlan, Output>
Admits a persist (§2.13): without a persisted layer unavailable
before the request is read, then the parse, then config.v1’s
checks. The runtime writes the plan’s entries, then calls
Owner::persisted.
§Errors
The refusal’s Output.
Sourcepub fn persisted(&mut self, plan: PersistPlan, mint: &mut dyn Mint) -> Output
pub fn persisted(&mut self, plan: PersistPlan, mint: &mut dyn Mint) -> Output
Commits a persist whose entries the runtime wrote: the record put
when a source moved, then the reply.
Sourcepub fn due(&mut self, now: Time, mint: &mut dyn Mint) -> Option<Step>
pub fn due(&mut self, now: Time, mint: &mut dyn Mint) -> Option<Step>
The act owed at now, if any (§2.9, §2.11): the deadline’s undo, or
the earliest reach apply whose apply_at has come.
Sourcepub fn finish(
&mut self,
now: Time,
result: DeviceResult,
mint: &mut dyn Mint,
) -> Step
pub fn finish( &mut self, now: Time, result: DeviceResult, mint: &mut dyn Mint, ) -> Step
Reports the device’s result for the act in flight, and answers what it owed.
Sourcepub fn report_desired(
&mut self,
report: Option<DesiredReport>,
mint: &mut dyn Mint,
) -> Output
pub fn report_desired( &mut self, report: Option<DesiredReport>, mint: &mut dyn Mint, ) -> Output
Sets the desired report the record carries (§2.18), putting the record when it changed.
Sourcepub fn converge(&self, doc: &DesiredConfig) -> Converge
pub fn converge(&self, doc: &DesiredConfig) -> Converge
What converging doc asks next (§2.18): config.v1’s, a revision
above 32 bits refused whole, naming no group, before any group is
read.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Owner
impl Freeze for Ownerwhere
*const u8 is !null: Freeze,
PhantomData<Entry>: Freeze,
PhantomData<(String, TypeDecl)>: Freeze,
*const LeafNode<String, Layout> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Layout)>>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<GroupDecl>: Freeze,
*const LeafNode<(String, String), (Value, Source)> is !null: Freeze,
PhantomData<Box<((String, String), (Value, Source))>>: Freeze,
*const LeafNode<(String, String), Value> is !null: Freeze,
PhantomData<Box<((String, String), Value)>>: Freeze,
*const LeafNode<(String, String), Slot> is !null: Freeze,
PhantomData<Box<((String, String), Slot)>>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<(String, String), EditRec> is !null: Freeze,
PhantomData<Box<((String, String), EditRec)>>: Freeze,
PhantomData<Wait>: Freeze,
PhantomData<Held>: Freeze,
PhantomData<Time>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<(String, String)>: Freeze,
PhantomData<(String, u64)>: Freeze,
PhantomData<Held>: Freeze,
impl Move for Owner
impl RefUnwindSafe for Owner
impl Send for Ownerwhere
RawVecInner: Send,
&'static str: Send,
NodeRef<Owned, String, Layout, LeafOrInternal>: Send,
BoxRaw<(String, Layout)>: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
NodeRef<Owned, (String, String), (Value, Source), LeafOrInternal>: Send,
BoxRaw<((String, String), (Value, Source))>: Send,
NodeRef<Owned, (String, String), Value, LeafOrInternal>: Send,
BoxRaw<((String, String), Value)>: Send,
NodeRef<Owned, (String, String), Slot, LeafOrInternal>: Send,
BoxRaw<((String, String), Slot)>: Send,
NodeRef<Owned, (String, String), EditRec, LeafOrInternal>: Send,
BoxRaw<((String, String), EditRec)>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
BoxRaw<ConfigView>: Send,
BoxRaw<ConfigStatus>: Send,
BoxRaw<State>: Send,
impl Sync for Ownerwhere
RawVecInner: Sync,
NodeRef<Owned, String, Layout, LeafOrInternal>: Sync,
BoxRaw<(String, Layout)>: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
NodeRef<Owned, (String, String), (Value, Source), LeafOrInternal>: Sync,
BoxRaw<((String, String), (Value, Source))>: Sync,
NodeRef<Owned, (String, String), Value, LeafOrInternal>: Sync,
BoxRaw<((String, String), Value)>: Sync,
NodeRef<Owned, (String, String), Slot, LeafOrInternal>: Sync,
BoxRaw<((String, String), Slot)>: Sync,
NodeRef<Owned, (String, String), EditRec, LeafOrInternal>: Sync,
BoxRaw<((String, String), EditRec)>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
BoxRaw<ConfigView>: Sync,
BoxRaw<ConfigStatus>: Sync,
BoxRaw<State>: Sync,
impl Unpin for Ownerwhere
*const u8 is !null: Unpin,
&'static str: Unpin,
*const LeafNode<String, Layout> is !null: Unpin,
Box<(String, Layout)>: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
*const LeafNode<(String, String), (Value, Source)> is !null: Unpin,
Box<((String, String), (Value, Source))>: Unpin,
*const LeafNode<(String, String), Value> is !null: Unpin,
Box<((String, String), Value)>: Unpin,
*const LeafNode<(String, String), Slot> is !null: Unpin,
Box<((String, String), Slot)>: Unpin,
*const LeafNode<(String, String), EditRec> is !null: Unpin,
Box<((String, String), EditRec)>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
Box<ConfigView>: Unpin,
Box<ConfigStatus>: Unpin,
Box<State>: Unpin,
impl UnsafeUnpin for Ownerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Entry>: UnsafeUnpin,
PhantomData<(String, TypeDecl)>: UnsafeUnpin,
*const LeafNode<String, Layout> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Layout)>>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<GroupDecl>: UnsafeUnpin,
*const LeafNode<(String, String), (Value, Source)> is !null: UnsafeUnpin,
PhantomData<Box<((String, String), (Value, Source))>>: UnsafeUnpin,
*const LeafNode<(String, String), Value> is !null: UnsafeUnpin,
PhantomData<Box<((String, String), Value)>>: UnsafeUnpin,
*const LeafNode<(String, String), Slot> is !null: UnsafeUnpin,
PhantomData<Box<((String, String), Slot)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<(String, String), EditRec> is !null: UnsafeUnpin,
PhantomData<Box<((String, String), EditRec)>>: UnsafeUnpin,
PhantomData<Wait>: UnsafeUnpin,
PhantomData<Held>: UnsafeUnpin,
PhantomData<Time>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<(String, u64)>: UnsafeUnpin,
PhantomData<Held>: UnsafeUnpin,
impl UnwindSafe for Ownerwhere
RawVecInner: UnwindSafe,
&'static str: UnwindSafe,
BTreeMap<String, Layout>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
BTreeMap<(String, String), (Value, Source)>: UnwindSafe,
BTreeMap<(String, String), Value>: UnwindSafe,
BTreeMap<(String, String), Slot>: UnwindSafe,
BTreeMap<(String, String), EditRec>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BoxRaw<ConfigView>: UnwindSafe,
BoxRaw<ConfigStatus>: UnwindSafe,
BoxRaw<State>: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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