pub struct StoreBundle { /* private fields */ }
Expand description
Stores many EntityDb
s of recordings and blueprints.
Implementations§
Source§impl StoreBundle
impl StoreBundle
Sourcepub fn from_rrd(
version_policy: VersionPolicy,
read: impl Read,
) -> Result<Self, StoreLoadError>
pub fn from_rrd( version_policy: VersionPolicy, read: impl Read, ) -> Result<Self, StoreLoadError>
Decode an rrd stream. It can theoretically contain multiple recordings, and blueprints.
Sourcepub fn entity_dbs(&self) -> impl Iterator<Item = &EntityDb>
pub fn entity_dbs(&self) -> impl Iterator<Item = &EntityDb>
All loaded EntityDb
, both recordings and blueprints, in arbitrary order.
Sourcepub fn entity_dbs_mut(&mut self) -> impl Iterator<Item = &mut EntityDb>
pub fn entity_dbs_mut(&mut self) -> impl Iterator<Item = &mut EntityDb>
All loaded EntityDb
, both recordings and blueprints, in arbitrary order.
pub fn append(&mut self, other: Self)
pub fn remove(&mut self, id: &StoreId) -> Option<EntityDb>
pub fn contains(&self, id: &StoreId) -> bool
pub fn get(&self, id: &StoreId) -> Option<&EntityDb>
pub fn get_mut(&mut self, id: &StoreId) -> Option<&mut EntityDb>
Sourcepub fn entry(&mut self, id: &StoreId) -> &mut EntityDb
pub fn entry(&mut self, id: &StoreId) -> &mut EntityDb
Returns either a recording or blueprint EntityDb
.
One is created if it doesn’t already exist.
Sourcepub fn blueprint_entry(&mut self, id: &StoreId) -> &mut EntityDb
pub fn blueprint_entry(&mut self, id: &StoreId) -> &mut EntityDb
Creates one if it doesn’t exist.
Like Self::entry
but also sets StoreInfo
to a default value.
pub fn insert(&mut self, entity_db: EntityDb)
Sourcepub fn recordings(&self) -> impl Iterator<Item = &EntityDb>
pub fn recordings(&self) -> impl Iterator<Item = &EntityDb>
In no particular order.
Sourcepub fn blueprints(&self) -> impl Iterator<Item = &EntityDb>
pub fn blueprints(&self) -> impl Iterator<Item = &EntityDb>
In no particular order.
pub fn retain(&mut self, f: impl FnMut(&EntityDb) -> bool)
Sourcepub fn drain_entity_dbs(&mut self) -> impl Iterator<Item = EntityDb> + '_
pub fn drain_entity_dbs(&mut self) -> impl Iterator<Item = EntityDb> + '_
In no particular order.
Sourcepub fn find_closest_recording(&self, id: &StoreId) -> Option<StoreId>
pub fn find_closest_recording(&self, id: &StoreId) -> Option<StoreId>
Returns the closest “neighbor” recording to the given id.
The closest neighbor is the next recording when sorted by (app ID, time), if any, or the previous one otherwise. This is used to update the selected recording when the current one is deleted.
Sourcepub fn find_oldest_modified_recording(&self) -> Option<StoreId>
pub fn find_oldest_modified_recording(&self) -> Option<StoreId>
Returns the StoreId
of the oldest modified recording, according to EntityDb::last_modified_at
.
Trait Implementations§
Source§impl Default for StoreBundle
impl Default for StoreBundle
Source§fn default() -> StoreBundle
fn default() -> StoreBundle
Auto Trait Implementations§
impl Freeze for StoreBundle
impl !RefUnwindSafe for StoreBundle
impl Send for StoreBundle
impl Sync for StoreBundle
impl Unpin for StoreBundle
impl !UnwindSafe for StoreBundle
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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>
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>
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