pub struct Validator { /* private fields */ }
Available on crate feature
validate
only.Expand description
A structure for validating STAC.
Implementations§
Source§impl Validator
impl Validator
Sourcepub fn validate<T>(&mut self, value: &T) -> Result<()>where
T: Serialize,
pub fn validate<T>(&mut self, value: &T) -> Result<()>where
T: Serialize,
Validates a single value.
§Examples
use stac::{Item, Validator};
let item = Item::new("an-id");
let mut validator = Validator::new().unwrap();
validator.validate(&item).unwrap();
Sourcepub fn validate_value(&mut self, value: Value) -> Result<Value>
pub fn validate_value(&mut self, value: Value) -> Result<Value>
If you have a serde_json::Value, you can skip a deserialization step by using this method.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Validator
impl !RefUnwindSafe for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl !UnwindSafe for Validator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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