pub struct Validator { /* private fields */ }
Expand description
A structure for validating STAC.
Implementations§
Source§impl Validator
impl Validator
Sourcepub async fn new() -> Result<Validator>
pub async fn new() -> Result<Validator>
Creates a new validator.
§Examples
use stac_validate::Validator;
#[tokio::main]
async fn main() {
let validator = Validator::new().await.unwrap();
}
Sourcepub async fn validate<T>(&mut self, value: &T) -> Result<()>where
T: Serialize,
pub async fn validate<T>(&mut self, value: &T) -> Result<()>where
T: Serialize,
Validates a single value.
§Examples
use stac::Item;
use stac_validate::Validate;
#[tokio::main]
async fn main() {
let mut item = Item::new("an-id");
item.validate().await.unwrap();
}
Sourcepub fn validate_value<'life_self, 'async_recursion>(
&'life_self mut self,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_recursion>>where
'life_self: 'async_recursion,
pub fn validate_value<'life_self, 'async_recursion>(
&'life_self mut self,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_recursion>>where
'life_self: 'async_recursion,
If you have a serde_json::Value, you can skip a deserialization step by using this method.
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