Skip to main content

ThreadNetworkDiagnostics

Struct ThreadNetworkDiagnostics 

Source
pub struct ThreadNetworkDiagnostics<'a, D: ThreadDriver, const E: usize = 4> { /* private fields */ }
Expand description

The Thread Network Diagnostics cluster (§11.14).

E is how many events the cluster holds before the oldest is dropped. A stack that flaps must not be able to grow this, and the device drains it every time round its own loop.

Implementations§

Source§

impl<'a, D: ThreadDriver, const E: usize> ThreadNetworkDiagnostics<'a, D, E>

Source

pub fn new(driver: &'a D, features: u32) -> Self

A cluster over a device’s own Thread stack.

Source

pub fn record(&self, event: Event)

Records one of §11.14.8’s events for the device to drain.

Public because both of them are the stack’s to notice.

Source

pub fn take_events(&self) -> Vec<Event, E>

Takes the events recorded since the last call.

Trait Implementations§

Source§

impl<D: ThreadDriver, const E: usize> Cluster for ThreadNetworkDiagnostics<'_, D, E>

So a tuple of clusters can dispatch to it by id.

Source§

const ID: ClusterId = ID

The cluster id this implementation serves.
Source§

impl<D: ThreadDriver, const E: usize> ClusterHandler for ThreadNetworkDiagnostics<'_, D, E>

Source§

fn read( &self, resolved: &Resolved<'_>, _ctx: &InteractionContext<'_>, w: &mut TlvWriter<'_>, tag: Tag, ) -> Result<(), Status>

Writes the value of resolved’s attribute under tag. Read more
Source§

fn invoke( &self, resolved: &ResolvedCommand<'_>, _fields: Option<&[u8]>, _ctx: &InteractionContext<'_>, _w: &mut TlvWriter<'_>, _tag: Tag, ) -> Result<Option<CommandId>, StatusIb>

Runs a command. Read more
Source§

fn data_version(&self, _resolved: &Resolved<'_>) -> Option<u32>

The cluster instance’s data version (§7.10.3), if it tracks one. Read more
Source§

fn write( &self, _resolved: &Resolved<'_>, _data: &[u8], _op: WriteOp, _ctx: &InteractionContext<'_>, ) -> Result<(), Status>

Writes data — the encoded TLV element, tag included — into the attribute. Read more
Source§

fn on_lifecycle(&self, _event: Lifecycle)

Reacts to something that happened to the node (see Lifecycle). Read more
Source§

impl<'a, D: Debug + ThreadDriver, const E: usize> Debug for ThreadNetworkDiagnostics<'a, D, E>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, D, const E: usize = 4> !Freeze for ThreadNetworkDiagnostics<'a, D, E>

§

impl<'a, D, const E: usize = 4> !RefUnwindSafe for ThreadNetworkDiagnostics<'a, D, E>

§

impl<'a, D, const E: usize = 4> !Sync for ThreadNetworkDiagnostics<'a, D, E>

§

impl<'a, D, const E: usize> Forget for ThreadNetworkDiagnostics<'a, D, E>

§

impl<'a, D, const E: usize> Move for ThreadNetworkDiagnostics<'a, D, E>

§

impl<'a, D, const E: usize> Send for ThreadNetworkDiagnostics<'a, D, E>
where &'a D: Send, RefCell<VecInner<Event, usize, VecStorageInner<[MaybeUninit<Event>; E]>>>: Send,

§

impl<'a, D, const E: usize> Unpin for ThreadNetworkDiagnostics<'a, D, E>
where &'a D: Unpin, RefCell<VecInner<Event, usize, VecStorageInner<[MaybeUninit<Event>; E]>>>: Unpin,

§

impl<'a, D, const E: usize> UnsafeUnpin for ThreadNetworkDiagnostics<'a, D, E>

§

impl<'a, D, const E: usize> UnwindSafe for ThreadNetworkDiagnostics<'a, D, E>

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.