pub struct PinnedIpc<'a, T: Marshal + Copy + 'static> { /* private fields */ }Expand description
Handle pinned to one family of the parent AdaptiveIpc.
Captures the active family + pin_generation at pin time. Holders
drive ops through as_ring or
as_deque for as long as
is_still_valid returns true. On
false (a migration has happened) the holder releases this pin
and calls AdaptiveIpc::pin_current_family to capture the new
family.
!Send + !Sync (via PhantomData<Cell<()>>): the pin captures
the active family at pin time and cannot safely cross a thread
boundary because the parent may migrate concurrently. Each thread
that wants pinned access acquires its own pin.
Implementations§
Source§impl<'a, T: Marshal + Copy + 'static> PinnedIpc<'a, T>
impl<'a, T: Marshal + Copy + 'static> PinnedIpc<'a, T>
Sourcepub fn pinned_generation(&self) -> u64
pub fn pinned_generation(&self) -> u64
Pin generation captured at pin time.
Sourcepub fn is_still_valid(&self) -> bool
pub fn is_still_valid(&self) -> bool
One Acquire load on the parent’s pin_generation. Returns
true while the pin is current; false if a migration has
happened and the caller should release + re-acquire.
Sourcepub fn as_ring(&self) -> Option<&AdaptiveRing>
pub fn as_ring(&self) -> Option<&AdaptiveRing>
Typed handle to the active AdaptiveRing backing.
Returns Some(&AdaptiveRing) when the pinned family is
SharedRing, None otherwise. The composition pattern:
chain into pin_current_shape() on the returned handle to
drop one more axis level and reach the shape-pinned native
primitive (PinnedRing<'_>), then call e.g.
.spsc_try_push() for the SPSC fast path. Two Acquire loads
total per validity check (one per axis), each at the
caller’s chosen cadence.
Sourcepub fn as_deque(&self) -> Option<&SharedDeque<PassSlot>>
pub fn as_deque(&self) -> Option<&SharedDeque<PassSlot>>
Typed handle to the active SharedDeque<PassSlot> backing.