pub struct SlotStorage {
physical: Option<(ContainerRef, usize)>,
dependencies: Vec<ContainerRef>,
}Expand description
Physical storage and auxiliary container dependencies used by a Slot.
Menu builders derive their complete lock set and physical-alias checks from this descriptor, so custom slots must include every container accessed by any slot callback.
Fields§
§physical: Option<(ContainerRef, usize)>§dependencies: Vec<ContainerRef>Implementations§
Source§impl SlotStorage
impl SlotStorage
Sourcepub fn physical(container: impl Into<ContainerRef>, index: usize) -> Self
pub fn physical(container: impl Into<ContainerRef>, index: usize) -> Self
Describes a slot backed by one physical container position.
Sourcepub fn virtual_slot(
dependencies: impl IntoIterator<Item = impl Into<ContainerRef>>,
) -> Self
pub fn virtual_slot( dependencies: impl IntoIterator<Item = impl Into<ContainerRef>>, ) -> Self
Describes a storage-less slot that only accesses auxiliary containers.
Sourcepub fn with_dependencies(
self,
dependencies: impl IntoIterator<Item = impl Into<ContainerRef>>,
) -> Self
pub fn with_dependencies( self, dependencies: impl IntoIterator<Item = impl Into<ContainerRef>>, ) -> Self
Adds auxiliary containers accessed by slot callbacks.
Sourcepub fn physical_backing(&self) -> Option<(&ContainerRef, usize)>
pub fn physical_backing(&self) -> Option<(&ContainerRef, usize)>
Returns the slot’s physical container and container-local index.
Sourcepub fn physical_key(&self) -> Option<(ContainerId, usize)>
pub fn physical_key(&self) -> Option<(ContainerId, usize)>
Returns the stable identity of the physical backing position.
pub(crate) fn container_refs(&self) -> impl Iterator<Item = &ContainerRef>
Auto Trait Implementations§
impl !RefUnwindSafe for SlotStorage
impl !UnwindSafe for SlotStorage
impl Freeze for SlotStorage
impl Send for SlotStorage
impl Sync for SlotStorage
impl Unpin for SlotStorage
impl UnsafeUnpin for SlotStorage
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>