pub enum SlotBackend {
Baseline(SlotTable),
Chunked(ChunkedSlotStorage),
Hierarchical(HierarchicalSlotStorage),
Split(SplitSlotStorage),
}Expand description
Unified slot storage backend that can use any implementation.
Variants§
Baseline(SlotTable)
Chunked(ChunkedSlotStorage)
Hierarchical(HierarchicalSlotStorage)
Split(SplitSlotStorage)
Implementations§
Source§impl SlotBackend
impl SlotBackend
Sourcepub fn new(kind: SlotBackendKind) -> Self
pub fn new(kind: SlotBackendKind) -> Self
Create a new backend of the specified kind.
NOTE: Currently, all backend kinds map to the Baseline implementation since the experimental backends (Chunked, Hierarchical, Split) are still under development and don’t pass all tests. This allows the backend infrastructure to exist while development continues.
Trait Implementations§
Source§impl Default for SlotBackend
impl Default for SlotBackend
Source§impl SlotStorage for SlotBackend
impl SlotStorage for SlotBackend
Source§type ValueSlot = ValueSlotId
type ValueSlot = ValueSlotId
Opaque handle to a value slot.
Source§fn begin_group(&mut self, key: Key) -> StartGroup<Self::Group>
fn begin_group(&mut self, key: Key) -> StartGroup<Self::Group>
Begin a group with the given key. Read more
Source§fn set_group_scope(&mut self, group: Self::Group, scope: usize)
fn set_group_scope(&mut self, group: Self::Group, scope: usize)
Associate the runtime recomposition scope with this group.
Source§fn skip_current_group(&mut self)
fn skip_current_group(&mut self)
Skip over the current group (used by the “skip optimization” in the macro).
Source§fn nodes_in_current_group(&self) -> Vec<NodeId> ⓘ
fn nodes_in_current_group(&self) -> Vec<NodeId> ⓘ
Return node ids that live in the current group (needed so the composer
can reattach them to the parent when skipping).
Source§fn begin_recranpose_at_scope(&mut self, scope: usize) -> Option<Self::Group>
fn begin_recranpose_at_scope(&mut self, scope: usize) -> Option<Self::Group>
Start recomposing the group that owns
scope. Returns the group we
started, or None if that scope is gone.Source§fn end_recompose(&mut self)
fn end_recompose(&mut self)
Finish the recomposition started with
begin_recranpose_at_scope.Source§fn alloc_value_slot<T: 'static>(
&mut self,
init: impl FnOnce() -> T,
) -> Self::ValueSlot
fn alloc_value_slot<T: 'static>( &mut self, init: impl FnOnce() -> T, ) -> Self::ValueSlot
Allocate or reuse a value slot at the current cursor.
Source§fn read_value<T: 'static>(&self, slot: Self::ValueSlot) -> &T
fn read_value<T: 'static>(&self, slot: Self::ValueSlot) -> &T
Immutable read of a value slot.
Source§fn read_value_mut<T: 'static>(&mut self, slot: Self::ValueSlot) -> &mut T
fn read_value_mut<T: 'static>(&mut self, slot: Self::ValueSlot) -> &mut T
Mutable read of a value slot.
Source§fn write_value<T: 'static>(&mut self, slot: Self::ValueSlot, value: T)
fn write_value<T: 'static>(&mut self, slot: Self::ValueSlot, value: T)
Overwrite an existing value slot.
Source§fn remember<T: 'static>(&mut self, init: impl FnOnce() -> T) -> Owned<T>
fn remember<T: 'static>(&mut self, init: impl FnOnce() -> T) -> Owned<T>
Convenience “remember” built on top of value slots.
Source§fn record_node(&mut self, id: NodeId)
fn record_node(&mut self, id: NodeId)
Record a node at the current cursor (and advance).
Source§fn advance_after_node_read(&mut self)
fn advance_after_node_read(&mut self)
Advance after we’ve read a node via the applier path.
Source§fn step_back(&mut self)
fn step_back(&mut self)
Step the cursor back by one (used when we probed and need to overwrite).
Source§fn finalize_current_group(&mut self) -> bool
fn finalize_current_group(&mut self) -> bool
“Finalize” the current group: mark unreachable tail as gaps.
Returns
true if we marked gaps (which means children are unstable).Auto Trait Implementations§
impl !Freeze for SlotBackend
impl !RefUnwindSafe for SlotBackend
impl !Send for SlotBackend
impl !Sync for SlotBackend
impl Unpin for SlotBackend
impl !UnwindSafe for SlotBackend
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