pub struct FakeHost { /* private fields */ }Expand description
Deterministic fake host boundary for resource status simulations.
Implementations§
Source§impl FakeHost
impl FakeHost
Sourcepub fn apply_result<C: Clone, O>(
&mut self,
ledger: &mut ResourceLedger<C>,
result: &TransactionResult<C, O>,
) -> Vec<FakeHostEvent>
pub fn apply_result<C: Clone, O>( &mut self, ledger: &mut ResourceLedger<C>, result: &TransactionResult<C, O>, ) -> Vec<FakeHostEvent>
Applies a transaction result to the ledger and returns explicit statuses.
Sourcepub fn observe<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
) -> FakeHostEvent
pub fn observe<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, ) -> FakeHostEvent
Produces a custom successful-open status event.
Sourcepub fn observe_outcome<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
status: HostResourceOutcome,
) -> FakeHostEvent
pub fn observe_outcome<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, status: HostResourceOutcome, ) -> FakeHostEvent
Produces a custom host outcome and classifies it through the ledger.
Sourcepub fn open_succeeded<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
) -> FakeHostEvent
pub fn open_succeeded<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, ) -> FakeHostEvent
Reports that an open command succeeded.
Sourcepub fn open_succeeds_later<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
) -> FakeHostEvent
pub fn open_succeeds_later<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, ) -> FakeHostEvent
Reports that an earlier open command succeeded after later graph work.
Sourcepub fn open_failed<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
reason: impl Into<String>,
) -> FakeHostEvent
pub fn open_failed<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, reason: impl Into<String>, ) -> FakeHostEvent
Reports that an open command failed.
Sourcepub fn close_succeeded<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
) -> FakeHostEvent
pub fn close_succeeded<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, ) -> FakeHostEvent
Reports that a close command succeeded.
Sourcepub fn close_failed<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
reason: impl Into<String>,
) -> FakeHostEvent
pub fn close_failed<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, reason: impl Into<String>, ) -> FakeHostEvent
Reports that a close command failed at the host boundary.
Sourcepub fn resource_lost<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
resource_key: ResourceKey,
scope: ScopeId,
command_revision: Revision,
reason: impl Into<String>,
) -> FakeHostEvent
pub fn resource_lost<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, resource_key: ResourceKey, scope: ScopeId, command_revision: Revision, reason: impl Into<String>, ) -> FakeHostEvent
Reports that a resource was externally lost outside graph propagation.
Sourcepub fn duplicate_status<C: Clone>(
&mut self,
ledger: &mut ResourceLedger<C>,
event: &FakeHostEvent,
) -> FakeHostEvent
pub fn duplicate_status<C: Clone>( &mut self, ledger: &mut ResourceLedger<C>, event: &FakeHostEvent, ) -> FakeHostEvent
Re-delivers a previous host status without assigning a new host revision.
Trait Implementations§
impl Eq for FakeHost
impl StructuralPartialEq for FakeHost
Auto Trait Implementations§
impl Freeze for FakeHost
impl RefUnwindSafe for FakeHost
impl Send for FakeHost
impl Sync for FakeHost
impl Unpin for FakeHost
impl UnsafeUnpin for FakeHost
impl UnwindSafe for FakeHost
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
Mutably borrows from an owned value. Read more