pub struct VirtualEndpointRegistry { /* private fields */ }Expand description
In-process registry mapping EndpointId to EndpointTarget.
Each rebind bumps the registry-wide generation counter so
pinned-endpoint holders see invalidation.
Implementations§
Source§impl VirtualEndpointRegistry
impl VirtualEndpointRegistry
Sourcepub fn bind(&self, id: EndpointId, target: EndpointTarget)
pub fn bind(&self, id: EndpointId, target: EndpointTarget)
Insert or replace the target for id. Bumps the generation.
Sourcepub fn unbind(&self, id: EndpointId) -> Option<EndpointTarget>
pub fn unbind(&self, id: EndpointId) -> Option<EndpointTarget>
Remove the binding for id, returning the prior target if
any. Bumps the generation.
Sourcepub fn lookup(&self, id: EndpointId) -> Option<EndpointTarget>
pub fn lookup(&self, id: EndpointId) -> Option<EndpointTarget>
Look up the target for id. Returns a clone so the caller
does not hold the registry lock across awaits.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Current generation. Pinned endpoints compare captured
generation against this on is_still_valid().
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for VirtualEndpointRegistry
impl RefUnwindSafe for VirtualEndpointRegistry
impl Send for VirtualEndpointRegistry
impl Sync for VirtualEndpointRegistry
impl Unpin for VirtualEndpointRegistry
impl UnsafeUnpin for VirtualEndpointRegistry
impl UnwindSafe for VirtualEndpointRegistry
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