pub struct RemoteInfo { /* private fields */ }Expand description
Information about a remote endpoint.
This information is a snapshot in time, i.e. it is not updating and may
already be outdated by the time you are reading this. Updated information
can only be retrieved by calling Endpoint::remote_info again.
Implementations§
Source§impl RemoteInfo
impl RemoteInfo
Sourcepub fn id(&self) -> EndpointId
pub fn id(&self) -> EndpointId
Returns the remote’s endpoint id.
Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddrInfo>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddrInfo>
Returns an iterator over known all addresses for this remote.
Note that this may include outdated or unusable addresses.
Sourcepub fn into_addrs(self) -> impl Iterator<Item = TransportAddrInfo>
pub fn into_addrs(self) -> impl Iterator<Item = TransportAddrInfo>
Converts into an iterator over known all addresses for this remote.
Note that this may include outdated or unusable addresses. You can use TransportAddrInfo::usage
to filter for addresses that are actively used.
You can use this to construct an EndpointAddr for this remote:
let info = endpoint.remote_info(remote_id).await.unwrap();
let addr = EndpointAddr::from_parts(info.id(), info.into_addrs().map(|addr| addr.into_addr()));Trait Implementations§
Source§impl Clone for RemoteInfo
impl Clone for RemoteInfo
Source§fn clone(&self) -> RemoteInfo
fn clone(&self) -> RemoteInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RemoteInfo
impl RefUnwindSafe for RemoteInfo
impl Send for RemoteInfo
impl Sync for RemoteInfo
impl Unpin for RemoteInfo
impl UnsafeUnpin for RemoteInfo
impl UnwindSafe for RemoteInfo
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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