pub trait ThreadDriver {
Show 26 methods
// Provided methods
fn channel(&self) -> Option<u16> { ... }
fn routing_role(&self) -> Option<RoutingRoleEnum> { ... }
fn network_name(&self) -> Option<&str> { ... }
fn pan_id(&self) -> Option<u16> { ... }
fn extended_pan_id(&self) -> Option<u64> { ... }
fn mesh_local_prefix(&self) -> Option<&[u8]> { ... }
fn overrun_count(&self) -> u64 { ... }
fn neighbors(&self) -> &[NeighborTableStruct] { ... }
fn routes(&self) -> &[RouteTableStruct] { ... }
fn partition_id(&self) -> Option<u32> { ... }
fn weighting(&self) -> Option<u16> { ... }
fn data_version(&self) -> Option<u16> { ... }
fn stable_data_version(&self) -> Option<u16> { ... }
fn leader_router_id(&self) -> Option<u8> { ... }
fn mle_counters(&self) -> MleCounters { ... }
fn mac_counters(&self) -> MacCounters { ... }
fn active_timestamp(&self) -> Option<u64> { ... }
fn pending_timestamp(&self) -> Option<u64> { ... }
fn delay(&self) -> Option<u32> { ... }
fn security_policy(&self) -> Option<SecurityPolicy> { ... }
fn channel_page0_mask(&self) -> Option<&[u8]> { ... }
fn operational_dataset_components(
&self,
) -> Option<OperationalDatasetComponents> { ... }
fn active_network_faults(&self) -> &[NetworkFaultEnum] { ... }
fn ext_address(&self) -> Option<u64> { ... }
fn rloc16(&self) -> Option<u16> { ... }
fn reset_counts(&self) { ... }
}Expand description
What a device’s Thread stack can report (§11.14.6).
Every method has a default, so an integrator implements only what the stack exposes. The
defaults are the conservative ones: null for the network state, empty for the tables, and
no counters at all.
Provided Methods§
Sourcefn routing_role(&self) -> Option<RoutingRoleEnum>
fn routing_role(&self) -> Option<RoutingRoleEnum>
RoutingRole (§11.14.6.2).
RoutingRoleEnum::Unassigned and null are not the same answer: the first is a
configured interface with no role yet, the second is no configured interface.
Sourcefn network_name(&self) -> Option<&str>
fn network_name(&self) -> Option<&str>
NetworkName (§11.14.6.3), at most sixteen octets.
Sourcefn extended_pan_id(&self) -> Option<u64>
fn extended_pan_id(&self) -> Option<u64>
ExtendedPanId (§11.14.6.5).
Sourcefn mesh_local_prefix(&self) -> Option<&[u8]>
fn mesh_local_prefix(&self) -> Option<&[u8]>
MeshLocalPrefix (§11.14.6.6) — an ipv6pre: one length octet, then the prefix.
Sourcefn overrun_count(&self) -> u64
fn overrun_count(&self) -> u64
OverrunCount (§11.14.6.7) — packets dropped for want of buffer memory. ERRCNT.
The one counter here that is mandatory within its feature and not nullable, so it is a
plain number: a device claiming ERRCNT has promised to count it.
Sourcefn neighbors(&self) -> &[NeighborTableStruct]
fn neighbors(&self) -> &[NeighborTableStruct]
NeighborTable (§11.14.6.8). Empty is a legitimate answer and null is not one.
Sourcefn routes(&self) -> &[RouteTableStruct]
fn routes(&self) -> &[RouteTableStruct]
RouteTable (§11.14.6.9).
Sourcefn partition_id(&self) -> Option<u32>
fn partition_id(&self) -> Option<u32>
PartitionId (§11.14.6.10).
Sourcefn weighting(&self) -> Option<u16>
fn weighting(&self) -> Option<u16>
Weighting (§11.14.6.11) — the leader weight this node’s partition is running at.
Sourcefn data_version(&self) -> Option<u16>
fn data_version(&self) -> Option<u16>
DataVersion (§11.14.6.12).
Sourcefn stable_data_version(&self) -> Option<u16>
fn stable_data_version(&self) -> Option<u16>
StableDataVersion (§11.14.6.13).
Sourcefn leader_router_id(&self) -> Option<u8>
fn leader_router_id(&self) -> Option<u8>
LeaderRouterId (§11.14.6.14).
Sourcefn mle_counters(&self) -> MleCounters
fn mle_counters(&self) -> MleCounters
The MLECNT counters (§11.14.6).
Sourcefn mac_counters(&self) -> MacCounters
fn mac_counters(&self) -> MacCounters
The MACCNT counters (§11.14.6).
Called once per counter read, so a driver that has to ask the radio should cache: a wildcard read of this cluster asks for thirty-four of them in a row.
Sourcefn active_timestamp(&self) -> Option<u64>
fn active_timestamp(&self) -> Option<u64>
ActiveTimestamp (§11.14.6.57) of the Active Operational Dataset.
Sourcefn pending_timestamp(&self) -> Option<u64>
fn pending_timestamp(&self) -> Option<u64>
PendingTimestamp (§11.14.6.58) of the Pending Operational Dataset.
Sourcefn delay(&self) -> Option<u32>
fn delay(&self) -> Option<u32>
Delay (§11.14.6.59) before a pending dataset is adopted, in milliseconds.
Sourcefn security_policy(&self) -> Option<SecurityPolicy>
fn security_policy(&self) -> Option<SecurityPolicy>
SecurityPolicy (§11.14.6.60).
Sourcefn channel_page0_mask(&self) -> Option<&[u8]>
fn channel_page0_mask(&self) -> Option<&[u8]>
ChannelPage0Mask (§11.14.6.61) — the channel mask as an octet string.
Sourcefn operational_dataset_components(&self) -> Option<OperationalDatasetComponents>
fn operational_dataset_components(&self) -> Option<OperationalDatasetComponents>
OperationalDatasetComponents (§11.14.6.62) — which parts of the dataset are present.
Sourcefn active_network_faults(&self) -> &[NetworkFaultEnum]
fn active_network_faults(&self) -> &[NetworkFaultEnum]
ActiveNetworkFaultsList (§11.14.6.63) — the faults currently detected, if any.
Sourcefn ext_address(&self) -> Option<u64>
fn ext_address(&self) -> Option<u64>
ExtAddress (§11.14.6.64) — the node’s IEEE 802.15.4 extended address.
Sourcefn reset_counts(&self)
fn reset_counts(&self)
ResetCounts (§11.14.7.1): zero every counter this cluster reports.
The default does nothing, which is correct for a driver that reports no counters. One that does must implement this, or a client’s reset silently fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".