pub struct Constant { /* private fields */ }Expand description
A checker that always returns the same verdict.
For tests, for cassette replay (US-1008), and for a flow being wired up before its real checker exists. It declares no grants and reads neither of its arguments, so it is trivially model-free and trivially deterministic.
Named for what it is. A checker that always passes is exactly the thing Law III exists to prevent, so it should be obvious in a flow definition that this is what is there.
§Example
use boundgraph_check::{Checker, Constant, LocalKey};
let key = LocalKey::from_seed("host-key-1", [7u8; 32]);
let evidence = tokio::runtime::Builder::new_current_thread()
.build()?
.block_on(Constant::failing("not implemented yet").check(&order, &condensate, &key))?;
assert!(!evidence.permits_commit());Implementations§
Trait Implementations§
Source§impl Checker for Constant
impl Checker for Constant
Source§fn judge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_order: &'life1 WorkOrder,
_condensate: &'life2 Condensate,
) -> Pin<Box<dyn Future<Output = Judgement> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn judge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_order: &'life1 WorkOrder,
_condensate: &'life2 Condensate,
) -> Pin<Box<dyn Future<Output = Judgement> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Decide. The part an implementation writes. Read more
Source§fn check<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
order: &'life1 WorkOrder,
condensate: &'life2 Condensate,
signer: &'life3 dyn Sign,
) -> Pin<Box<dyn Future<Output = Result<Evidence, CheckError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn check<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
order: &'life1 WorkOrder,
condensate: &'life2 Condensate,
signer: &'life3 dyn Sign,
) -> Pin<Box<dyn Future<Output = Result<Evidence, CheckError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Check the authority, decide, bind the verdict to its inputs, and sign. Read more
impl Eq for Constant
impl StructuralPartialEq for Constant
Auto Trait Implementations§
impl Freeze for Constant
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnsafeUnpin for Constant
impl UnwindSafe for Constant
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