Struct re_entity_db::store_bundle::StoreBundle
source · pub struct StoreBundle {
entity_dbs: HashMap<StoreId, EntityDb>,
}
Expand description
Stores many EntityDb
s of recordings and blueprints.
Fields§
§entity_dbs: HashMap<StoreId, EntityDb>
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>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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