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_val_with(
&self,
type_id: TypeId,
value: Value,
exec_state: &mut ExecutionState<'_>,
remap: &(dyn Fn(Value) -> Value + Send + Sync),
) -> Value
pub fn rebuild_val_with( &self, type_id: TypeId, value: Value, exec_state: &mut ExecutionState<'_>, remap: &(dyn Fn(Value) -> Value + Send + Sync), ) -> Value
Rebuild a single container value by remapping each contained value
through remap, returning the (possibly new) interned value, or value
unchanged if it is not a registered container of the type behind
type_id.
Unlike ContainerValues::rebuild_all, which drives rebuilds off the
backend union-find, the caller supplies the remapping explicitly and
identifies the container type dynamically by its TypeId.
Sourcepub fn rebuild_all(
&mut self,
table_id: TableId,
table: &WrappedTable,
exec_state: &mut ExecutionState<'_>,
) -> ContainerRebuildSummary
pub fn rebuild_all( &mut self, table_id: TableId, table: &WrappedTable, exec_state: &mut ExecutionState<'_>, ) -> ContainerRebuildSummary
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 ContainerValue 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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more