Skip to main content

ScanResults

Struct ScanResults 

Source
pub struct ScanResults<'w, 'b> { /* private fields */ }
Expand description

Where a NetworkDriver puts what it found.

A typed sink rather than a raw TlvWriter, so the encoding stays in this module and a driver cannot emit a structure the specification does not define. §11.9.7.2 asks for a particular order — “Results SHOULD be reported in decreasing RSSI order … to maximize the likelihood that most likely to be reachable elements are included within the size limits of the response” — which is the driver’s to honour, since only it knows the signal strengths.

Implementations§

Source§

impl ScanResults<'_, '_>

Source

pub fn wifi(&mut self, result: &WiFiScanResult<'_>) -> Result<(), NetworkStatus>

Appends a Wi-Fi result.

Returns NetworkStatus::BoundsExceeded once the response buffer is full, which is not a failure: §11.9.7.2 says the list “MAY contain a subset of possibilities, to avoid memory exhaustion on the cluster server and avoid crossing the maximum command response size supported”.

Source

pub fn thread( &mut self, result: &ThreadScanResult<'_>, ) -> Result<(), NetworkStatus>

Appends a Thread result.

Source

pub const fn len(&self) -> usize

How many results have been written.

Source

pub const fn is_empty(&self) -> bool

Whether nothing was found — which is a legitimate Success.

Source

pub const fn is_full(&self) -> bool

Whether the response filled up and later results are being dropped.

A driver reporting in decreasing signal order, as §11.9.7.2 asks, can stop here.

Auto Trait Implementations§

§

impl<'w, 'b> !UnwindSafe for ScanResults<'w, 'b>

§

impl<'w, 'b> Forget for ScanResults<'w, 'b>

§

impl<'w, 'b> Freeze for ScanResults<'w, 'b>

§

impl<'w, 'b> Move for ScanResults<'w, 'b>

§

impl<'w, 'b> RefUnwindSafe for ScanResults<'w, 'b>

§

impl<'w, 'b> Send for ScanResults<'w, 'b>

§

impl<'w, 'b> Sync for ScanResults<'w, 'b>

§

impl<'w, 'b> Unpin for ScanResults<'w, 'b>

§

impl<'w, 'b> UnsafeUnpin for ScanResults<'w, 'b>

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.

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.