Trait SortableWithContext

Source
pub trait SortableWithContext<'s, A: 's>: Sized {
    type Meta: Meta<'s, Self>;

    // Required method
    fn get_meta(access: A) -> Self::Meta;
}
Available on crate feature sort only.
Expand description

Something that can describe its sort orders, if a context value is provided.

A type implementing SortableWithContext can provide a Meta which describes its sorting fields, but only when a context object is provided. Note that the provided context object be stored within the Meta, which is the origin of the lifetime parameter on that type.

This can be derived via the SortableWithPersianRug derive macro for the case of a persian-rug type.

Required Associated Types§

Source

type Meta: Meta<'s, Self>

Meta is the type which can describe our fields and their operators.

Required Methods§

Source

fn get_meta(access: A) -> Self::Meta

get_meta produces an instance of our Meta type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'s, A, T, C> SortableWithContext<'s, A> for Proxy<T>
where T: SortableWithContext<'s, A> + Contextual<Context = C>, A: Accessor<Context = C> + 's, C: Context + Owner<T>,

Source§

type Meta = ProxyMeta<A>

Available on crate feature sort only.
Source§

fn get_meta(access: A) -> Self::Meta

Available on crate feature sort only.
Source§

impl<'s, T, A> SortableWithContext<'s, A> for Option<T>
where T: SortableWithContext<'s, A>, A: 's + Clone,

Source§

type Meta = OptionMetaWithContext<A>

Source§

fn get_meta(access: A) -> Self::Meta

Implementors§