pub struct ById;Expand description
Keyed storage: each item under its id, in memory by id and then
Identified::order.
Trait Implementations§
impl Copy for ById
impl Eq for ById
Source§impl ItemStorage for ById
impl ItemStorage for ById
Source§fn refresh_with_ids<T: Model + Identified>(
items: &mut Vec<T>,
known: &mut Option<Vec<Arc<str>>>,
doc: &Doc,
map: &ObjId,
delta: &Delta,
) -> Result<(), ModelError>
fn refresh_with_ids<T: Model + Identified>( items: &mut Vec<T>, known: &mut Option<Vec<Arc<str>>>, doc: &Doc, map: &ObjId, delta: &Delta, ) -> Result<(), ModelError>
Finds each touched item by the id kept beside it and asks only the items it read for their ids; sorts only when they are out of place.
Source§const NAME: &'static str = "keyed items"
const NAME: &'static str = "keyed items"
What a stored value that is not of this storage is called in errors.
fn load<T: Model + Identified>( doc: &Doc, map: &ObjId, ) -> Result<Vec<T>, ModelError>
Source§fn store<T: Model + Identified>(
items: &[T],
doc: &mut Doc,
slot: Slot<'_>,
) -> Result<(), ModelError>
fn store<T: Model + Identified>( items: &[T], doc: &mut Doc, slot: Slot<'_>, ) -> Result<(), ModelError>
Write
items into slot.impl StructuralPartialEq for ById
Auto Trait Implementations§
impl Forget for ById
impl Freeze for ById
impl Move for ById
impl RefUnwindSafe for ById
impl Send for ById
impl Sync for ById
impl Unpin for ById
impl UnsafeUnpin for ById
impl UnwindSafe for ById
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more