Skip to main content

Protocols

Struct Protocols 

Source
pub struct Protocols(/* private fields */);
Available on crate feature rustcrypto only.
Expand description

Which protocols the upper layer will accept (§4.10.3.1).

“The Interaction Model layer indicates to the Exchange Layer which Protocols it will accept. Any message for a Protocol ID that is not registered with the Exchange Layer SHALL be dropped.”

This is not bookkeeping. §4.10.5.2 opens an exchange for any unsolicited message with the I flag, and on the unsecured session that is any datagram at all — so the set of protocols a node answers is also the set an attacker can make it allocate for. A node that registers only what it serves refuses the rest before the exchange table is touched.

Implementations§

Source§

impl Protocols

Source

pub const NONE: Self

Nothing registered — every unsolicited message is dropped.

Source

pub const SECURE_CHANNEL: Self

Secure Channel (§4.11). Every node needs it: it is how sessions are established.

Source

pub const INTERACTION_MODEL: Self

The Interaction Model (ch. 8) — what a node that serves clusters registers.

Source

pub const BDX: Self

BDX (§11.22), for a node that transfers files.

Source

pub const USER_DIRECTED_COMMISSIONING: Self

User Directed Commissioning (§5.3).

Source

pub const FOR_TESTING: Self

The range reserved for testing.

Source

pub const DEVICE: Self

What an ordinary device registers: Secure Channel and the Interaction Model.

Source

pub const fn with(self, other: Self) -> Self

Both of these, registered.

Source

pub const fn contains(self, protocol: ProtocolId) -> bool

Whether protocol is registered.

A vendor-specific protocol id is never registered: §4.10.3.1’s registration is by identity, and this node serves none.

Trait Implementations§

Source§

impl Clone for Protocols

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Protocols

Source§

impl Debug for Protocols

Source§

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

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

impl Default for Protocols

Source§

fn default() -> Self

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

impl Eq for Protocols

Source§

impl PartialEq for Protocols

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Protocols

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.