Skip to main content

Checklist

Struct Checklist 

Source
pub struct Checklist { /* private fields */ }
Expand description

One data stream’s checklist, its triggered-check queue and its valid list.

Implementations§

Source§

impl Checklist

Source

pub fn new(pairs: Vec<CandidatePair>) -> Self

A checklist over these pairs, before §6.1.2.6 has set any state.

Source

pub fn pairs(&self) -> &[CandidatePair]

The pairs, in checklist order.

Source

pub fn pair(&self, id: PairId) -> Option<&CandidatePair>

The pair with this identity.

Source

pub fn pair_mut(&mut self, id: PairId) -> Option<&mut CandidatePair>

The pair with this identity, mutably.

Source

pub fn state(&self) -> ChecklistState

The checklist’s state. Running until §6.1.2.6 has run.

Source

pub fn set_state(&mut self, state: ChecklistState)

Set the checklist’s state (§7.2.5.4, §8.1.2).

Source

pub fn valid(&self) -> &[ValidPair]

The valid list (§7.2.5.3.2).

Source

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.

Source

pub fn nominate_valid(&mut self, generated_by: PairId)

Mark the valid pair a check produced as nominated (§7.2.5.3.4).

Source

pub fn remove_valid(&mut self, generated_by: PairId)

Drop a valid pair whose nominated check later failed (§7.2.5.3.4).

Source

pub fn trigger(&mut self, id: PairId)

Enqueue a triggered check (§7.3.1.4). A pair already queued is not queued twice.

Source

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.

Source

pub fn has_triggered(&self) -> bool

Whether anything at all is queued for a triggered check.

Source

pub fn is_triggered(&self, id: PairId) -> bool

Whether a triggered check is queued for this pair.

Source

pub fn find(&self, local: LocalId, remote: RemoteId) -> Option<PairId>

The pair joining these two candidates, if the checklist has one.

Source

pub fn insert(&mut self, pair: CandidatePair)

Insert a pair §7.3.1.4 built from an inbound check, “based on its priority”.

Source

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.

Source

pub fn components(&self) -> Vec<ComponentId>

The components this checklist has pairs for.

Source

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§

Source§

impl Debug for Checklist

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Checklist

Source§

fn default() -> Checklist

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,