Skip to main content

Fabrics

Struct Fabrics 

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

All fabrics

Implementations§

Source§

impl Fabrics

Source

pub const fn new() -> Fabrics

Create a new Fabrics instance

Source

pub fn init() -> impl Init<Fabrics>

Return an in-place-initializer for a Fabrics type

Source

pub fn reset(&mut self)

Remove all fabrics

Source

pub fn reset_persist<S>( &mut self, store: S, buf: &mut [u8], ) -> Result<(), Error>
where S: KvBlobStore,

Remove all fabrics from the provided BLOB store as well as from memory.

§Arguments
  • store: the BLOB store to remove the fabrics from
  • buf: a temporary buffer to use for removing the fabrics
Source

pub fn load_persist<S>(&mut self, store: S, buf: &mut [u8]) -> Result<(), Error>
where S: KvBlobStore,

Load all fabrics from the provided BLOB store

§Arguments
  • store: the BLOB store to load the fabrics from
  • buf: a temporary buffer to use for loading the fabrics
Source

pub fn add_with_post_init<F>( &mut self, post_init: F, ) -> Result<&mut Fabric, Error>
where F: FnOnce(&mut Fabric) -> Result<(), Error>,

Add a new fabric to the fabrics with the provided data and immediately updates it with the provided post-init updater.

This method is unlikely to be useful outside of tests.

If this operation succeeds, the fabric immediately becomes operational.

Source

pub fn add<C>( &mut self, crypto: C, secret_key: CryptoSensitiveRef<'_, rs_matter::::crypto::canon::CanonPkcSecretKeyRef::{constant#0}>, root_ca: &[u8], noc: &[u8], icac: &[u8], epoch_key: Option<CryptoSensitiveRef<'_, rs_matter::::crypto::canon::CanonAeadKeyRef::{constant#0}>>, vendor_id: u16, case_admin_subject: u64, ) -> Result<&mut Fabric, Error>
where C: Crypto,

Add a new fabric to the fabrics with the provided data.

If this operation succeeds, the fabric immediately becomes operational.

Source

pub fn update<C>( &mut self, crypto: C, fab_idx: NonZero<u8>, secret_key: CryptoSensitiveRef<'_, rs_matter::::crypto::canon::CanonPkcSecretKeyRef::{constant#0}>, noc: &[u8], icac: &[u8], ) -> Result<&mut Fabric, Error>
where C: Crypto,

Update an existing fabric with the provided data (usually, as a result of an UpdateNOC IM command).

The fabric’s existing root cert is preserved across this call — UpdateNOC per Matter Core spec is not allowed to change the root, and re-passing the bytes would force the caller to take a (large) heap-less copy of Fabric::root_ca.

If this operation succeeds, the fabric immediately becomes operational. Note however, that the caller is expected to remove all sessions associated with the fabric, as they would contain invalid keys after the NOC update.

Source

pub fn update_label( &mut self, fab_idx: NonZero<u8>, label: &str, ) -> Result<&mut Fabric, Error>

Source

pub fn remove(&mut self, fab_idx: NonZero<u8>) -> Result<(), Error>

Remove a fabric from the fabrics

Source

pub fn get_by_dest_id<C>( &self, crypto: C, random: &[u8], target: &[u8], ) -> Option<&Fabric>
where C: Crypto,

Get a fabric that matches the provided destination ID

Source

pub fn get(&self, fab_idx: NonZero<u8>) -> Option<&Fabric>

Get a fabric by its local index

Source

pub fn get_mut(&mut self, fab_idx: NonZero<u8>) -> Option<&mut Fabric>

Get a mutable fabric reference by its local index

Source

pub fn iter(&self) -> impl Iterator<Item = &Fabric>

Iterate over the fabrics

Source

pub fn fabric(&self, fab_idx: NonZero<u8>) -> Result<&Fabric, Error>

Get a fabric by its local index

Returns an error if the fabric is not found

Source

pub fn fabric_mut(&mut self, fab_idx: NonZero<u8>) -> Result<&mut Fabric, Error>

Get a mutable fabric reference by its local index

Returns an error if the fabric is not found

Source

pub fn allow(&self, req: &AccessReq<'_>, aux_acl_enabled: bool) -> bool

Check if the given access request should be allowed, based on all operational fabrics and their ACLs

aux_acl_enabled conveys whether the node advertises the Access Control cluster’s AUXILIARY feature - see AclEntry::allow.

Trait Implementations§

Source§

impl Default for Fabrics

Source§

fn default() -> Fabrics

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, E> Init<T, E> for T

Source§

unsafe fn __init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
Source§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. 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
Source§

impl<T, I> IntoFallibleInit<T> for I
where I: Init<T>,

Source§

fn into_fallible<E>(self) -> impl Init<T, E>

Convert the infallible initializer to a fallible one.
Source§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

Source§

type Error = <Target as OctetsFrom<Source>>::Error

Source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
Source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
Source§

impl<T, E> PinInit<T, E> for T

Source§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
Source§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>
where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

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

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.
Source§

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

Source§

fn vzip(self) -> V