Trait stac_validate::ValidateCore

source ·
pub trait ValidateCore: Serialize {
    // Required method
    fn validate_core_json(
        value: &Value,
        validator: &mut Validator,
    ) -> Result<()>;
}
Expand description

Trait for validating STAC objects against their core schema only.

If your STAC object is the same version as stac::STAC_VERSION, this will be a quick, cheap operation, since the schemas are stored in the library.

Required Methods§

source

fn validate_core_json(value: &Value, validator: &mut Validator) -> Result<()>

Validate a serde_json::Value against a specific STAC jsonschema.

§Examples

stac::Item implements ValidateCore:

use stac_validate::ValidateCore;
use stac::Item;

let item = Item::new("an-id");
let value = serde_json::to_value(item).unwrap();
Item::validate_core_json(&value, &mut stac_validate::Validator::new()).unwrap();

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ValidateCore for Value

source§

fn validate_core_json(value: &Value, validator: &mut Validator) -> Result<()>

source§

impl ValidateCore for Value

source§

fn validate_core_json(value: &Value, validator: &mut Validator) -> Result<()>

source§

impl ValidateCore for Catalog

source§

fn validate_core_json(value: &Value, validator: &mut Validator) -> Result<()>

source§

impl ValidateCore for Collection

source§

fn validate_core_json(value: &Value, validator: &mut Validator) -> Result<()>

source§

impl ValidateCore for Item

source§

fn validate_core_json(value: &Value, validator: &mut Validator) -> Result<()>

source§

impl ValidateCore for ItemCollection

source§

fn validate_core_json(value: &Value, validator: &mut Validator) -> Result<()>

Implementors§