Skip to main content

Container

Trait Container 

Source
pub trait Container {
    type Item: Item;

    // Required methods
    fn revision(&self) -> Revision;
    fn items_as_parsed(&self) -> &[Uitem<Self::Item>];

    // Provided methods
    fn items(&self) -> Vec<Self::Item> { ... }
    fn metadata_items(&self) -> Vec<&MetadataItem> { ... }
}
Expand description

Trait for Unified containers, that exposes the items within them.

Required Associated Types§

Source

type Item: Item

The type of data item in this unified container.

Required Methods§

Source

fn revision(&self) -> Revision

Returns the revision of the unified encoding.

Source

fn items_as_parsed(&self) -> &[Uitem<Self::Item>]

Returns all items (data and metadata) in the order they were parsed from the string encoding.

Provided Methods§

Source

fn items(&self) -> Vec<Self::Item>

Returns the data items contained within this container, sorted in preference order.

Source

fn metadata_items(&self) -> Vec<&MetadataItem>

Returns just the metadata items from this container.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§