pub struct SchemaChecker { /* private fields */ }Expand description
Rejects a condensate payload that does not match a declared schema.
§Example
use boundgraph_check::{Schema, SchemaChecker};
use serde_json::json;
let schema = Schema::compile(&json!({
"type": "object",
"properties": { "severity": { "enum": ["low", "high"] } },
"required": ["severity"],
}))?;
assert!(schema.validate(&json!({ "severity": "high" })).is_valid());
let bad = schema.validate(&json!({ "severity": "catastrophic" }));
assert!(!bad.is_valid());
let checker = SchemaChecker::new(schema);Implementations§
Source§impl SchemaChecker
impl SchemaChecker
Trait Implementations§
Source§impl Checker for SchemaChecker
impl Checker for SchemaChecker
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
Source§impl Clone for SchemaChecker
impl Clone for SchemaChecker
Auto Trait Implementations§
impl Freeze for SchemaChecker
impl RefUnwindSafe for SchemaChecker
impl Send for SchemaChecker
impl Sync for SchemaChecker
impl Unpin for SchemaChecker
impl UnsafeUnpin for SchemaChecker
impl UnwindSafe for SchemaChecker
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