Struct hedwig::validators::JsonSchemaValidator [−][src]
pub struct JsonSchemaValidator { /* fields omitted */ }
This is supported on crate feature
json-schema
only.Expand description
Validator that validates JSON payloads according to a provided JSON Schema.
Implementations
Construct a new JSON schema validator.
The schema
argument must contain the JSON-encoded JSON-schema.
pub fn from_reader<R>(
schema: R
) -> Result<JsonSchemaValidator, JsonSchemaValidatorError> where
R: Read,
pub fn from_reader<R>(
schema: R
) -> Result<JsonSchemaValidator, JsonSchemaValidatorError> where
R: Read,
Construct a new JSON schema validator.
Construct a new JSON schema validator.
pub fn validate<M: Serialize>(
&self,
id: Uuid,
timestamp: SystemTime,
schema: &'static str,
headers: Headers,
data: &M
) -> Result<ValidatedMessage, JsonSchemaValidatorError>
pub fn validate<M: Serialize>(
&self,
id: Uuid,
timestamp: SystemTime,
schema: &'static str,
headers: Headers,
data: &M
) -> Result<ValidatedMessage, JsonSchemaValidatorError>
Validate the JSON payload using JSON schema and construct a ValidatedMessage
.
Auto Trait Implementations
impl !RefUnwindSafe for JsonSchemaValidator
impl Send for JsonSchemaValidator
impl !Sync for JsonSchemaValidator
impl Unpin for JsonSchemaValidator
impl !UnwindSafe for JsonSchemaValidator
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more