Struct stac::Collection

source ·
pub struct Collection {
    pub extensions: Option<Vec<String>>,
    pub id: String,
    pub title: Option<String>,
    pub description: String,
    pub keywords: Option<Vec<String>>,
    pub license: String,
    pub providers: Option<Vec<Provider>>,
    pub extent: Extent,
    pub summaries: Option<Map<String, Value>>,
    pub links: Vec<Link>,
    pub assets: HashMap<String, Asset>,
    pub additional_fields: Map<String, Value>,
    /* private fields */
}
Expand description

The STAC Collection Specification defines a set of common fields to describe a group of Items that share properties and metadata.

The Collection Specification shares all fields with the STAC Catalog Specification (with different allowed values for type and extensions) and adds fields to describe the whole dataset and the included set of Items. Collections can have both parent Catalogs and Collections and child Items, Catalogs and Collections.

A STAC Collection is represented in JSON format. Any JSON object that contains all the required fields is a valid STAC Collection and also a valid STAC Catalog.

Fields§

§extensions: Option<Vec<String>>

A list of extension identifiers the Collection implements.

§id: String

Identifier for the Collection that is unique across the provider.

§title: Option<String>

A short descriptive one-line title for the Collection.

§description: String

Detailed multi-line description to fully explain the Collection.

CommonMark 0.29 syntax MAY be used for rich text representation.

§keywords: Option<Vec<String>>

List of keywords describing the Collection.

§license: String

Collection’s license(s), either a SPDX License identifier, "various" if multiple licenses apply or "proprietary" for all other cases.

§providers: Option<Vec<Provider>>

A list of providers, which may include all organizations capturing or processing the data or the hosting provider.

Providers should be listed in chronological order with the most recent provider being the last element of the list.

§extent: Extent

Spatial and temporal extents.

§summaries: Option<Map<String, Value>>

A map of property summaries, either a set of values, a range of values or a JSON Schema.

§links: Vec<Link>

A list of references to other documents.

§assets: HashMap<String, Asset>

Dictionary of asset objects that can be downloaded, each with a unique key.

§additional_fields: Map<String, Value>

Additional fields not part of the Collection specification.

Implementations§

source§

impl Collection

source

pub fn new(id: impl ToString, description: impl ToString) -> Collection

Creates a new Collection with the given id.

Examples
use stac::Collection;
let collection = Collection::new("an-id", "a description");
assert_eq!(collection.id, "an-id");
assert_eq!(collection.description, "a description");

Trait Implementations§

source§

impl Assets for Collection

source§

fn assets(&self) -> &HashMap<String, Asset>

Returns a reference to this object’s assets. Read more
source§

fn assets_mut(&mut self) -> &mut HashMap<String, Asset>

Returns a mut reference to this object’s assets. Read more
source§

impl Clone for Collection

source§

fn clone(&self) -> Collection

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Collection

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Collection

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Extensions for Collection

source§

fn extensions(&self) -> Option<&[String]>

Returns a reference to this object’s extensions. Read more
source§

impl Href for Collection

source§

fn href(&self) -> Option<&str>

Gets this object’s href.
source§

fn set_href(&mut self, href: impl ToString)

Sets this object’s href.
Returns a reference to this object’s links. Read more
Returns a mutable reference to this object’s links. Read more
Returns the first link with the given rel type. Read more
Sets a link of the given rel type. Read more
Returns this object’s root link. Read more
Returns this object’s self link. Read more
Returns this object’s parent link. Read more
Returns an iterator over this object’s child links. Read more
Returns an iterator over this object’s item links. Read more
Makes all relative links absolute with respect to an href. Read more
Removes all relative links. Read more
source§

impl PartialEq<Collection> for Collection

source§

fn eq(&self, other: &Collection) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Collection

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<Collection> for Map<String, Value>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(collection: Collection) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<Map<String, Value>> for Collection

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(map: Map<String, Value>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Validate for Collection

Available on crate feature jsonschema only.
source§

fn validate(self) -> Result<(), Vec<Error>>

Validate this STAC object using a one-time-use Validator. Read more
source§

impl StructuralPartialEq for Collection

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,