pub struct ItemCollection {
    pub type: String,
    pub items: Vec<Item>,
    pub links: Vec<Link>,
    pub number_matched: Option<u64>,
    pub number_returned: Option<u64>,
    pub context: Option<Context>,
    pub additional_fields: Map<String, Value>,
}
Expand description

The return value of the /items and /search endpoints.

This might be a stac::ItemCollection, but if the fields extension is used, it might not be. Defined by the itemcollection fragment.

Fields§

§type: String

Always “FeatureCollection” to provide compatibility with GeoJSON.

§items: Vec<Item>

A possibly-empty array of Item objects.

§links: Vec<Link>

An array of Links related to this ItemCollection.

§number_matched: Option<u64>

The number of Items that meet the selection parameters, possibly estimated.

§number_returned: Option<u64>

The number of Items in the features array.

§context: Option<Context>

The search-related metadata for the ItemCollection.

Part of the context extension.

§additional_fields: Map<String, Value>

Additional fields.

Implementations§

source§

impl ItemCollection

source

pub fn new(items: Vec<Item>) -> Result<ItemCollection>

Creates a new ItemCollection from a vector of items.

Examples
let item: stac_api::Item = stac::Item::new("an-id").try_into().unwrap();
let item_collection = stac_api::ItemCollection::new(vec![item]).unwrap();

Trait Implementations§

source§

impl Debug for ItemCollection

source§

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

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

impl Default for ItemCollection

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ItemCollection

source§

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

Deserialize this value from the given Serde deserializer. Read more
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
Removes all structural links. Read more
source§

impl Serialize for ItemCollection

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

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
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.
source§

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

Performs the conversion.
source§

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