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>
impl<'a> PinnedEndpoint<'a>
Sourcepub fn id(&self) -> EndpointId
pub fn id(&self) -> EndpointId
Endpoint id this pin was captured for.
Sourcepub fn pinned_generation(&self) -> u64
pub fn pinned_generation(&self) -> u64
Generation captured at pin time.
Sourcepub fn is_still_valid(&self) -> bool
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.
Sourcepub fn as_local(&self) -> Option<&Arc<LocaleAdaptiveRing>>
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.
Sourcepub fn as_remote(&self) -> Option<&RemoteEndpoint>
pub fn as_remote(&self) -> Option<&RemoteEndpoint>
Returns Some(&RemoteEndpoint) when the captured target is
remote, None otherwise.