pub struct PathCandidate {
pub addr: SocketAddr,
pub rtt: Duration,
pub path_type: PathType,
}Expand description
A candidate path with measured RTT
Fields§
§addr: SocketAddrSocket address of the path
rtt: DurationMeasured round-trip time
path_type: PathTypeType of path (direct or relay)
Implementations§
Source§impl PathCandidate
impl PathCandidate
Sourcepub fn new(addr: SocketAddr, rtt: Duration) -> Self
pub fn new(addr: SocketAddr, rtt: Duration) -> Self
Create a new direct path candidate
Sourcepub fn direct(addr: SocketAddr, rtt: Duration) -> Self
pub fn direct(addr: SocketAddr, rtt: Duration) -> Self
Create a direct path candidate
Sourcepub fn relay(addr: SocketAddr, rtt: Duration) -> Self
pub fn relay(addr: SocketAddr, rtt: Duration) -> Self
Create a relay path candidate
Sourcepub fn effective_rtt(&self) -> Duration
pub fn effective_rtt(&self) -> Duration
Calculate effective RTT (with IPv6 advantage applied)
Trait Implementations§
Source§impl Clone for PathCandidate
impl Clone for PathCandidate
Source§fn clone(&self) -> PathCandidate
fn clone(&self) -> PathCandidate
Returns a duplicate of the value. Read more
1.0.0 · 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 PathCandidate
impl RefUnwindSafe for PathCandidate
impl Send for PathCandidate
impl Sync for PathCandidate
impl Unpin for PathCandidate
impl UnwindSafe for PathCandidate
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