[][src]Struct queriable_storage::SortedIndex

pub struct SortedIndex<T> { /* fields omitted */ }

Index of a DataStore.

Implementations

impl<T> SortedIndex<T> where
    T: Ord
[src]

pub fn new<F, U>(data_store: &QueriableDataStore<U>, index_provider: F) -> Self where
    F: Fn(&U) -> T, 
[src]

Creates a new Index from a DataStore for the index provided by the index_provider function.

pub fn filter_range<R>(&self, range: R) -> DataFilter where
    R: RangeBounds<T>, 
[src]

Get a new DataFilter for all items in the given range.

pub fn filter_between(
    &self,
    lower_inclusive: T,
    upper_inclusive: T
) -> DataFilter
[src]

Get a new DataFilter for all items between the given values (including lower and upper value).

pub fn filter_eq(&self, value: T) -> DataFilter[src]

Get a new DataFilter for all items that are equivalent to the given value.

pub fn filter_gt(&self, lower_limit: T) -> DataFilter[src]

Get a new DataFilter for all items that are greater than the given value.

pub fn filter_gte(&self, lower_limit: T) -> DataFilter[src]

Get a new DataFilter for all items that are greater than ore equal to the given value.

pub fn filter_lt(&self, upper_limit: T) -> DataFilter[src]

Get a new DataFilter for all items that are less than the given value.

pub fn filter_lte(&self, upper_limit: T) -> DataFilter[src]

Get a new DataFilter for all items that are less than ore equal to the given value.

pub fn first(&self) -> DataFilter[src]

Get the first element in the index

pub fn first_n(&self, n: usize) -> DataFilter[src]

Get the first n elements of the index (less if the amount of items is smaller then n)

pub fn last(&self) -> DataFilter[src]

Get the last element in the index

pub fn last_n(&self, n: usize) -> DataFilter[src]

Get the last n elements of the index (less if the amount of items is smaller then n)

Trait Implementations

impl<T: Clone> Clone for SortedIndex<T>[src]

impl<T: Eq> Eq for SortedIndex<T>[src]

impl<T: PartialEq> PartialEq<SortedIndex<T>> for SortedIndex<T>[src]

impl<T> StructuralEq for SortedIndex<T>[src]

impl<T> StructuralPartialEq for SortedIndex<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for SortedIndex<T> where
    T: RefUnwindSafe

impl<T> Send for SortedIndex<T> where
    T: Send

impl<T> Sync for SortedIndex<T> where
    T: Sync

impl<T> Unpin for SortedIndex<T> where
    T: Unpin

impl<T> UnwindSafe for SortedIndex<T> where
    T: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.