pub struct Fabrics { /* private fields */ }Expand description
All fabrics
Implementations§
Source§impl Fabrics
impl Fabrics
Sourcepub fn reset_persist<S>(
&mut self,
store: S,
buf: &mut [u8],
) -> Result<(), Error>where
S: KvBlobStore,
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 frombuf: a temporary buffer to use for removing the fabrics
Sourcepub fn load_persist<S>(&mut self, store: S, buf: &mut [u8]) -> Result<(), Error>where
S: KvBlobStore,
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 frombuf: a temporary buffer to use for loading the fabrics
Sourcepub fn add_with_post_init<F>(
&mut self,
post_init: F,
) -> Result<&mut Fabric, Error>
pub fn add_with_post_init<F>( &mut self, post_init: F, ) -> Result<&mut Fabric, 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.
Sourcepub 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,
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.
Sourcepub 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,
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.
pub fn update_label( &mut self, fab_idx: NonZero<u8>, label: &str, ) -> Result<&mut Fabric, Error>
Sourcepub fn remove(&mut self, fab_idx: NonZero<u8>) -> Result<(), Error>
pub fn remove(&mut self, fab_idx: NonZero<u8>) -> Result<(), Error>
Remove a fabric from the fabrics
Sourcepub fn get_by_dest_id<C>(
&self,
crypto: C,
random: &[u8],
target: &[u8],
) -> Option<&Fabric>where
C: Crypto,
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
Sourcepub fn get_mut(&mut self, fab_idx: NonZero<u8>) -> Option<&mut Fabric>
pub fn get_mut(&mut self, fab_idx: NonZero<u8>) -> Option<&mut Fabric>
Get a mutable fabric reference by its local index
Sourcepub fn fabric(&self, fab_idx: NonZero<u8>) -> Result<&Fabric, Error>
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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fabrics
impl RefUnwindSafe for Fabrics
impl Send for Fabrics
impl Sync for Fabrics
impl Unpin for Fabrics
impl UnsafeUnpin for Fabrics
impl UnwindSafe for Fabrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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