pub struct VirtualEndpoint { /* private fields */ }Expand description
A virtual endpoint handle. Holds a reference to the registry +
the endpoint id. Application code calls pin_current_target()
to get a target snapshot, then dispatches on
as_local() / as_remote() to do work.
Implementations§
Source§impl VirtualEndpoint
impl VirtualEndpoint
Sourcepub fn bind(
registry: Arc<VirtualEndpointRegistry>,
id: EndpointId,
target: EndpointTarget,
) -> Self
pub fn bind( registry: Arc<VirtualEndpointRegistry>, id: EndpointId, target: EndpointTarget, ) -> Self
Bind a fresh endpoint and return a handle to it.
Sourcepub fn attach(
registry: Arc<VirtualEndpointRegistry>,
id: EndpointId,
) -> Option<Self>
pub fn attach( registry: Arc<VirtualEndpointRegistry>, id: EndpointId, ) -> Option<Self>
Construct a handle pointing at an already-bound endpoint.
Returns None if no binding exists.
Sourcepub fn id(&self) -> EndpointId
pub fn id(&self) -> EndpointId
The endpoint’s id.
Sourcepub fn pin_current_target(&self) -> Option<PinnedEndpoint<'_>>
pub fn pin_current_target(&self) -> Option<PinnedEndpoint<'_>>
Capture the current target and return a pinned handle.
Returns None if the endpoint has been unbound.
Auto Trait Implementations§
impl Freeze for VirtualEndpoint
impl RefUnwindSafe for VirtualEndpoint
impl Send for VirtualEndpoint
impl Sync for VirtualEndpoint
impl Unpin for VirtualEndpoint
impl UnsafeUnpin for VirtualEndpoint
impl UnwindSafe for VirtualEndpoint
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