pub struct Fabric { /* private fields */ }Expand description
Fabric type
Implementations§
Source§impl Fabric
impl Fabric
pub fn mdns_service(&self) -> Option<MatterLocalService>
pub fn mdns_service_for(&self, node_id: u64) -> Option<MatterLocalService>
Sourcepub fn is_dest_id<C>(
&self,
crypto: C,
random: &[u8],
target: &[u8],
) -> Result<(), Error>where
C: Crypto,
pub fn is_dest_id<C>(
&self,
crypto: C,
random: &[u8],
target: &[u8],
) -> Result<(), Error>where
C: Crypto,
Is the fabric matching the privided destination ID
Sourcepub fn compute_dest_id<C>(
&self,
crypto: C,
random: &[u8],
target_node_id: u64,
out: &mut CryptoSensitive<rs_matter::::crypto::canon::Hash::{constant#0}>,
) -> Result<(), Error>where
C: Crypto,
pub fn compute_dest_id<C>(
&self,
crypto: C,
random: &[u8],
target_node_id: u64,
out: &mut CryptoSensitive<rs_matter::::crypto::canon::Hash::{constant#0}>,
) -> Result<(), Error>where
C: Crypto,
Compute the destination identifier for a target node on this fabric.
Used by the CASE initiator to build Sigma1 (spec). destinationMessage = initiatorRandom || rootPublicKey || fabricId(LE) || nodeId(LE) destinationIdentifier = Crypto_HMAC(key=IPK, message=destinationMessage)
§Arguments
target_node_id: The node ID of the destination (peer) node, NOT the local node.
Sourcepub fn secret_key(
&self,
) -> CryptoSensitiveRef<'_, rs_matter::::crypto::canon::CanonPkcSecretKeyRef::{constant#0}>
pub fn secret_key( &self, ) -> CryptoSensitiveRef<'_, rs_matter::::crypto::canon::CanonPkcSecretKeyRef::{constant#0}>
Return the secret key of the fabric
Sourcepub fn compressed_fabric_id(&self) -> u64
pub fn compressed_fabric_id(&self) -> u64
Return the fabric’s compressed fabric ID
Sourcepub fn root_ca(&self) -> &[u8] ⓘ
pub fn root_ca(&self) -> &[u8] ⓘ
Return the fabric’s Root CA in encoded TLV form
Use CertRef to decode on the fly
Sourcepub fn icac(&self) -> &[u8] ⓘ
pub fn icac(&self) -> &[u8] ⓘ
Return the fabric’s ICAC in encoded TLV form
Use CertRef to decode on the fly.
Note that this method might return an empty slice,
which indicates that this fabric does not have an ICAC.
(The shared icac_or_vvsc slot may instead hold a VVSC; see
vvsc().)
Sourcepub fn vvsc(&self) -> &[u8] ⓘ
pub fn vvsc(&self) -> &[u8] ⓘ
Return the fabric’s VVSC bytes (Matter Core spec).
Empty when SetVIDVerificationStatement has never been called with
a non-empty VVSC for this fabric, or when the fabric instead carries
an ICAC (see icac()) — VVSC and ICAC share storage and are
mutually exclusive per spec.
Sourcepub fn vid_verification_statement(&self) -> &[u8] ⓘ
pub fn vid_verification_statement(&self) -> &[u8] ⓘ
Return the fabric’s VID Verification Statement bytes (Matter Core
spec). Either empty (not set) or
exactly VID_VERIFICATION_STATEMENT_LEN bytes.
Sourcepub fn set_vid_verification(
&mut self,
vendor_id: Option<u16>,
vid_verification_statement: Option<&[u8]>,
vvsc: Option<&[u8]>,
) -> Result<(), Error>
pub fn set_vid_verification( &mut self, vendor_id: Option<u16>, vid_verification_statement: Option<&[u8]>, vvsc: Option<&[u8]>, ) -> Result<(), Error>
Apply a SetVIDVerificationStatement mutation to the fabric. Each
field is Some(slice) for “replace with this value” (where an
empty slice clears the value), or None for “leave unchanged”.
The caller is responsible for spec-level validation (size limits,
VVSC vs ICAC mutual exclusion, “all fields absent” → INVALID_COMMAND,
VendorID range, …); this method only enforces the storage
invariants (heapless Vec capacity).
Sourcepub fn acl_iter(&self) -> impl Iterator<Item = &AclEntry>
pub fn acl_iter(&self) -> impl Iterator<Item = &AclEntry>
Return an iterator over the ACL entries of the fabric
Sourcepub fn acl_add(&mut self, entry: AclEntry) -> Result<usize, Error>
pub fn acl_add(&mut self, entry: AclEntry) -> Result<usize, Error>
Add a new ACL entry to the fabric.
Return the index of the added entry.
Sourcepub fn acl_add_init<I>(&mut self, init: I) -> Result<usize, Error>
pub fn acl_add_init<I>(&mut self, init: I) -> Result<usize, Error>
Add a new ACL entry to the fabric using the supplied initializer.
Return the index of the added entry.
Sourcepub fn acl_update(&mut self, idx: usize, entry: AclEntry) -> Result<(), Error>
pub fn acl_update(&mut self, idx: usize, entry: AclEntry) -> Result<(), Error>
Update an existing ACL entry in the fabric
Sourcepub fn acl_update_init<I>(&mut self, idx: usize, init: I) -> Result<(), Error>
pub fn acl_update_init<I>(&mut self, idx: usize, init: I) -> Result<(), Error>
Update an existing ACL entry in the fabric using the supplied initializer
Sourcepub fn acl_remove(&mut self, idx: usize) -> Result<(), Error>
pub fn acl_remove(&mut self, idx: usize) -> Result<(), Error>
Remove an ACL entry from the fabric
Sourcepub fn acl_remove_all(&mut self)
pub fn acl_remove_all(&mut self)
Remove all ACL entries from the fabric
Trait Implementations§
Source§impl<'__from_tlv> FromTLV<'__from_tlv> for Fabric
impl<'__from_tlv> FromTLV<'__from_tlv> for Fabric
Source§fn from_tlv(element: &TLVElement<'__from_tlv>) -> Result<Fabric, Error>
fn from_tlv(element: &TLVElement<'__from_tlv>) -> Result<Fabric, Error>
Source§fn init_from_tlv(element: TLVElement<'__from_tlv>) -> impl Init<Fabric, Error>
fn init_from_tlv(element: TLVElement<'__from_tlv>) -> impl Init<Fabric, Error>
Source§fn nullable_from_tlv(element: &TLVElement<'a>) -> Result<Self, Error>
fn nullable_from_tlv(element: &TLVElement<'a>) -> Result<Self, Error>
Source§fn init_nullable_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
fn init_nullable_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
Source§impl ToTLV for Fabric
impl ToTLV for Fabric
Source§fn to_tlv<W>(&self, tag: &TLVTag, tw: W) -> Result<(), Error>where
W: TLVWrite,
fn to_tlv<W>(&self, tag: &TLVTag, tw: W) -> Result<(), Error>where
W: TLVWrite,
Source§fn tlv_iter(&self, tag: TLVTag) -> impl Iterator<Item = Result<TLV<'_>, Error>>
fn tlv_iter(&self, tag: TLVTag) -> impl Iterator<Item = Result<TLV<'_>, Error>>
TLV instances by potentially borrowing
data from the type.Auto Trait Implementations§
impl Freeze for Fabric
impl RefUnwindSafe for Fabric
impl Send for Fabric
impl Sync for Fabric
impl Unpin for Fabric
impl UnsafeUnpin for Fabric
impl UnwindSafe for Fabric
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