pub struct ContainerValues { /* private fields */ }Implementations§
Source§impl ContainerValues
impl ContainerValues
pub fn new() -> Self
Sourcepub fn for_each<C: ContainerValue>(&self, f: impl FnMut(&C, Value))
pub fn for_each<C: ContainerValue>(&self, f: impl FnMut(&C, Value))
Iterate over the containers of the given type.
Sourcepub fn get_val<C: ContainerValue>(
&self,
val: Value,
) -> Option<impl Deref<Target = C> + '_>
pub fn get_val<C: ContainerValue>( &self, val: Value, ) -> Option<impl Deref<Target = C> + '_>
Get the container associated with the value val in the database. The caller must know the
type of the container.
The return type of this function may contain lock guards. Attempts to modify the contents of the containers database may deadlock if the given guard has not been dropped.
pub fn register_val<C: ContainerValue>( &self, container: C, exec_state: &mut ExecutionState<'_>, ) -> Value
Sourcepub fn rebuild_all(
&mut self,
table_id: TableId,
table: &WrappedTable,
exec_state: &mut ExecutionState<'_>,
) -> bool
pub fn rebuild_all( &mut self, table_id: TableId, table: &WrappedTable, exec_state: &mut ExecutionState<'_>, ) -> bool
Apply the given rebuild to the contents of each container.
Sourcepub fn register_type<C: ContainerValue>(
&mut self,
id_counter: CounterId,
merge_fn: impl MergeFn + 'static,
) -> ContainerValueId
pub fn register_type<C: ContainerValue>( &mut self, id_counter: CounterId, merge_fn: impl MergeFn + 'static, ) -> ContainerValueId
Add a new container type to the given [Containers] instance.
Container types need a meaans of generating fresh ids (id_counter) along with a means of
merging conflicting ids (merge_fn).
Trait Implementations§
Source§impl Clone for ContainerValues
impl Clone for ContainerValues
Source§fn clone(&self) -> ContainerValues
fn clone(&self) -> ContainerValues
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ContainerValues
impl Default for ContainerValues
Source§fn default() -> ContainerValues
fn default() -> ContainerValues
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContainerValues
impl !RefUnwindSafe for ContainerValues
impl Send for ContainerValues
impl Sync for ContainerValues
impl Unpin for ContainerValues
impl !UnwindSafe for ContainerValues
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> 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