pub trait SortedIndexKeyContentSource<Payload>: Sizedwhere
Payload: SortedIndexKeyPayload,{
// Required methods
fn sort_key(&self) -> u16;
fn into_content(self) -> <Payload as SortedIndexKeyPayload>::Content;
// Provided methods
fn into_sort_key_and_content(
self
) -> (u16, <Payload as SortedIndexKeyPayload>::Content) { ... }
fn into_key(self) -> Payload { ... }
}
Expand description
This trait is intended to be implemented by types which embody the content of a key for a particular sorted index collection.
Note:
- Multiple types might be mappable into the key payload, and so implement this trait
- This trait is only one way - from value into content
- This trait uses a generic, because the same type might be usable as a key for multiple explicit substates
Required Methods§
fn sort_key(&self) -> u16
fn into_content(self) -> <Payload as SortedIndexKeyPayload>::Content
Provided Methods§
fn into_sort_key_and_content( self ) -> (u16, <Payload as SortedIndexKeyPayload>::Content)
fn into_key(self) -> Payload
Object Safety§
This trait is not object safe.