Skip to main content

PinnedEndpoint

Struct PinnedEndpoint 

Source
pub struct PinnedEndpoint<'a> { /* private fields */ }
Expand description

Pinned snapshot of a virtual endpoint’s target. Captures the registry generation at pin time; one Acquire load on is_still_valid() detects rebinds.

Implementations§

Source§

impl<'a> PinnedEndpoint<'a>

Source

pub fn id(&self) -> EndpointId

Endpoint id this pin was captured for.

Source

pub fn pinned_generation(&self) -> u64

Generation captured at pin time.

Source

pub fn is_still_valid(&self) -> bool

One Acquire load on the registry’s generation counter. Returns true while the pin is current; false if any bind / unbind has happened on ANY endpoint in the registry since pin time.

The coarse-grained check is intentional: a registry-wide generation is one atomic load per check, vs per-endpoint generations which require lookup + dereference. Callers that pin many endpoints in a tight loop trade some false-positive re-acquires for a much cheaper validity check.

Source

pub fn as_local(&self) -> Option<&Arc<LocaleAdaptiveRing>>

Returns Some(&Arc<LocaleAdaptiveRing>) when the captured target is local, None otherwise. The Arc is borrowed from the pinned target snapshot and lives for the pin’s lifetime.

Source

pub fn as_remote(&self) -> Option<&RemoteEndpoint>

Returns Some(&RemoteEndpoint) when the captured target is remote, None otherwise.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for PinnedEndpoint<'a>

§

impl<'a> !Sync for PinnedEndpoint<'a>

§

impl<'a> !UnwindSafe for PinnedEndpoint<'a>

§

impl<'a> Freeze for PinnedEndpoint<'a>

§

impl<'a> Send for PinnedEndpoint<'a>

§

impl<'a> Unpin for PinnedEndpoint<'a>

§

impl<'a> UnsafeUnpin for PinnedEndpoint<'a>

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.