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

    // Provided method
    fn validate_core(&self) -> 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: &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, &stac_validate::Validator::new()).unwrap();

Provided Methods§

source

fn validate_core(&self) -> Result<()>

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

Examples

stac::Item implements ValidateCore:

use stac_validate::ValidateCore;
let item = stac::Item::new("an-id");
item.validate_core().unwrap();

Implementations on Foreign Types§

source§

impl ValidateCore for Item

source§

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

source§

impl ValidateCore for Catalog

source§

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

source§

impl ValidateCore for ItemCollection

source§

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

source§

impl ValidateCore for Collection

source§

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

source§

impl ValidateCore for Value

source§

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

Implementors§