Skip to main content

PinnedIpc

Struct PinnedIpc 

Source
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>

Source

pub fn family(&self) -> MmfFamily

Family this pin was captured at.

Source

pub fn pinned_generation(&self) -> u64

Pin generation captured at pin time.

Source

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.

Source

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.

Source

pub fn as_deque(&self) -> Option<&SharedDeque<PassSlot>>

Typed handle to the active SharedDeque<PassSlot> backing.

Auto Trait Implementations§

§

impl<'a, T> !RefUnwindSafe for PinnedIpc<'a, T>

§

impl<'a, T> !Sync for PinnedIpc<'a, T>

§

impl<'a, T> !UnwindSafe for PinnedIpc<'a, T>

§

impl<'a, T> Freeze for PinnedIpc<'a, T>
where &'a AdaptiveIpc<T>: Freeze,

§

impl<'a, T> Send for PinnedIpc<'a, T>
where &'a AdaptiveIpc<T>: Send,

§

impl<'a, T> Unpin for PinnedIpc<'a, T>
where &'a AdaptiveIpc<T>: Unpin,

§

impl<'a, T> UnsafeUnpin for PinnedIpc<'a, T>
where &'a AdaptiveIpc<T>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.