pub struct Agent { /* private fields */ }Expand description
The sans-IO ICE agent.
One agent per data stream, which is one checklist. The checklist set it holds is still a set
— see super::checklist — because §6.1.2.6’s unfreezing rule is stated over the set.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn new(
config: Config,
offerer: bool,
credentials: Credentials,
tiebreaker: u64,
) -> Self
pub fn new( config: Config, offerer: bool, credentials: Credentials, tiebreaker: u64, ) -> Self
A new agent.
offerer is whether sipx sent the initial offer, which is §6.1.1’s role determination for
two full agents; tiebreaker is §7.1.3’s 64-bit value, chosen at random per ICE session.
The initial tiebreaker is the caller’s so that a test can choose it — §7.3.1.1’s T = V
row is not reachable otherwise. The redraw after a 487 is not, and cannot be: §7.2.5.1
requires the value to change, and in the symmetric conflict both ends apply the same rule
to the same old value, so anything derived from it leaves them equal and oscillating (see
this module’s fresh_tiebreaker). That one path reaches for the process RNG, as
stun::new_transaction_id already does for every check’s transaction ID. Randomness is
not I/O — no clock is read and no socket is touched — but it does mean the 487 path is the
one place a test can pin only that the value changed, not what it became.
Sourcepub const fn tiebreaker(&self) -> u64
pub const fn tiebreaker(&self) -> u64
Our tiebreaker (§7.1.3). It changes when a 487 does (§7.2.5.1).
Sourcepub const fn credentials(&self) -> &Credentials
pub const fn credentials(&self) -> &Credentials
Our short-term credentials — what a later offer or answer must put in a=ice-ufrag and
a=ice-pwd for this stream (spec §13.5).
Read rather than remembered by the caller: these change under Input::LocalCredentials,
and a signalling layer holding its own copy is a second place for them to be right.
Sourcepub const fn checklists(&self) -> &ChecklistSet
pub const fn checklists(&self) -> &ChecklistSet
The checklist set.
Sourcepub fn local_candidates(&self) -> &[LocalCandidate]
pub fn local_candidates(&self) -> &[LocalCandidate]
The local candidates, including any peer-reflexive one §7.2.5.3.1 learned.
Sourcepub fn remote_candidates(&self) -> &[RemoteCandidate]
pub fn remote_candidates(&self) -> &[RemoteCandidate]
The remote candidates, including any peer-reflexive one §7.3.1.3 learned.
Sourcepub fn selected(
&self,
component: ComponentId,
) -> Option<(LocalBase, SocketAddr)>
pub fn selected( &self, component: ComponentId, ) -> Option<(LocalBase, SocketAddr)>
The selected pair for a component, once there is one (§8.1.1).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more