pub struct Checklist { /* private fields */ }Expand description
One data stream’s checklist, its triggered-check queue and its valid list.
Implementations§
Source§impl Checklist
impl Checklist
Sourcepub fn new(pairs: Vec<CandidatePair>) -> Self
pub fn new(pairs: Vec<CandidatePair>) -> Self
A checklist over these pairs, before §6.1.2.6 has set any state.
Sourcepub fn pairs(&self) -> &[CandidatePair]
pub fn pairs(&self) -> &[CandidatePair]
The pairs, in checklist order.
Sourcepub fn pair(&self, id: PairId) -> Option<&CandidatePair>
pub fn pair(&self, id: PairId) -> Option<&CandidatePair>
The pair with this identity.
Sourcepub fn pair_mut(&mut self, id: PairId) -> Option<&mut CandidatePair>
pub fn pair_mut(&mut self, id: PairId) -> Option<&mut CandidatePair>
The pair with this identity, mutably.
Sourcepub fn state(&self) -> ChecklistState
pub fn state(&self) -> ChecklistState
The checklist’s state. Running until §6.1.2.6 has run.
Sourcepub fn set_state(&mut self, state: ChecklistState)
pub fn set_state(&mut self, state: ChecklistState)
Set the checklist’s state (§7.2.5.4, §8.1.2).
Sourcepub fn add_valid(&mut self, pair: ValidPair) -> bool
pub fn add_valid(&mut self, pair: ValidPair) -> bool
Add a valid pair, or update the one already there for the same local and remote.
Returns whether it was new, which is what arms spec §8’s Tn: the stopping criterion
counts from the first valid pair, and a retransmitted check that revalidates a pair
already in the list must not restart it.
Sourcepub fn nominate_valid(&mut self, generated_by: PairId)
pub fn nominate_valid(&mut self, generated_by: PairId)
Mark the valid pair a check produced as nominated (§7.2.5.3.4).
Sourcepub fn remove_valid(&mut self, generated_by: PairId)
pub fn remove_valid(&mut self, generated_by: PairId)
Drop a valid pair whose nominated check later failed (§7.2.5.3.4).
Sourcepub fn trigger(&mut self, id: PairId)
pub fn trigger(&mut self, id: PairId)
Enqueue a triggered check (§7.3.1.4). A pair already queued is not queued twice.
Sourcepub fn take_triggered(&mut self) -> Option<PairId>
pub fn take_triggered(&mut self) -> Option<PairId>
Take the next triggered check. §6.1.4.1’s queue is FIFO, and §6.1.4.2 empties it before it
looks at any Waiting pair — which is what makes ICE converge in the time it takes a
peer’s check to arrive rather than in checklist order.
Sourcepub fn has_triggered(&self) -> bool
pub fn has_triggered(&self) -> bool
Whether anything at all is queued for a triggered check.
Sourcepub fn is_triggered(&self, id: PairId) -> bool
pub fn is_triggered(&self, id: PairId) -> bool
Whether a triggered check is queued for this pair.
Sourcepub fn find(&self, local: LocalId, remote: RemoteId) -> Option<PairId>
pub fn find(&self, local: LocalId, remote: RemoteId) -> Option<PairId>
The pair joining these two candidates, if the checklist has one.
Sourcepub fn insert(&mut self, pair: CandidatePair)
pub fn insert(&mut self, pair: CandidatePair)
Insert a pair §7.3.1.4 built from an inbound check, “based on its priority”.
Sourcepub fn sort(&mut self)
pub fn sort(&mut self)
Sort into decreasing pair priority (§6.1.2.3).
Stable, so that equal priorities keep the order they were formed in: §6.1.2.3 says ties are ordered arbitrarily, and a test that asserts on a checklist needs the same arbitrary answer twice.
Sourcepub fn components(&self) -> Vec<ComponentId>
pub fn components(&self) -> Vec<ComponentId>
The components this checklist has pairs for.
Sourcepub fn keep_only_nominated(&mut self, component: ComponentId, keep: PairId)
pub fn keep_only_nominated(&mut self, component: ComponentId, keep: PairId)
Remove every pair for a component but the one just nominated (§8.1.2).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Checklist
impl RefUnwindSafe for Checklist
impl Send for Checklist
impl Sync for Checklist
impl Unpin for Checklist
impl UnsafeUnpin for Checklist
impl UnwindSafe for Checklist
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