Trait Container

Source
pub trait Container {
    type Item: Item;

    // Required method
    fn items_as_parsed(&self) -> &[Self::Item];

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

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

Required Associated Types§

Source

type Item: Item

The type of item in this unified container.

Required Methods§

Source

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

Returns the items in the order they were parsed from the string encoding.

This API is for advanced usage; in most cases you should use Self::items.

Provided Methods§

Source

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

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

Implementors§