pub struct BasicInfoSettings {
pub node_label: StringInner<usize, VecStorageInner<[MaybeUninit<u8>; 32]>>,
pub location: Option<StringInner<usize, VecStorageInner<[MaybeUninit<u8>; 2]>>>,
pub location_type: Option<RegulatoryLocationTypeEnum>,
pub local_config_disabled: bool,
pub configuration_version: u32,
pub device_location: Option<Maybe<DeviceLocation, AsNullable>>,
pub recovery_identifier: Option<u64>,
}Expand description
Mutable basic information
Fields§
§node_label: StringInner<usize, VecStorageInner<[MaybeUninit<u8>; 32]>>§location: Option<StringInner<usize, VecStorageInner<[MaybeUninit<u8>; 2]>>>§location_type: Option<RegulatoryLocationTypeEnum>The regulatory location type, as set via
GeneralCommissioning::SetRegulatoryConfig.
local_config_disabled: bool§configuration_version: u32BasicInformation::ConfigurationVersion (Matter Core Spec).
Non-volatile, monotonically increasing, minimum 1.
Bumped by application code via
InteractionModel::bump_configuration_version whenever the node’s
fixed-quality surface (Server/Parts list, device types, software
version, …) changes — see Matter Core Spec.
device_location: Option<Maybe<DeviceLocation, AsNullable>>BasicInformation::DeviceLocation (provisional in the Matter 1.6
IDL): where the device is installed, admin-writable.
recovery_identifier: Option<u64>GeneralCommissioning::RecoveryIdentifier (provisional in Matter 1.6):
a random 64-bit value that identifies this node during the
Network Recovery flow without revealing its Node ID.
NOTE: keep this field last - the persisted-blob TLV tags are positional, and appending preserves compatibility with blobs written before the field existed.
Implementations§
Source§impl BasicInfoSettings
impl BasicInfoSettings
Sourcepub const fn new() -> BasicInfoSettings
pub const fn new() -> BasicInfoSettings
Create a new instance of BasicInfoSettings
Sourcepub fn init() -> impl Init<BasicInfoSettings>
pub fn init() -> impl Init<BasicInfoSettings>
Return an in-place initializer for BasicInfoSettings
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Resets the basic info to initial values
§Arguments
flag_changed: whether to mark the basic info settings as changed
Sourcepub fn bump_configuration_version(&mut self) -> u32
pub fn bump_configuration_version(&mut self) -> u32
Bump ConfigurationVersion by one and return the new value.
Saturates at u32::MAX (the spec gives no wrap semantics, so
staying at the max is safer than rolling over to 0 which would
violate the min 1 constraint).
This routine only mutates the in-memory value. Persistence and
subscriber notification are the caller’s responsibility — use
InteractionModel::bump_configuration_version for the full
“bump + persist + notify + dataver-bump” pass.
Sourcepub fn set_location(&mut self, location: &str)
pub fn set_location(&mut self, location: &str)
Set the location (country code) to the given (2-character) value.
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 basic info settings from the provided BLOB store as well as from memory
§Arguments
store: the BLOB store to remove the settings frombuf: a temporary buffer to use for removing the settings
Sourcepub fn load(&mut self, data: &[u8]) -> Result<(), Error>
pub fn load(&mut self, data: &[u8]) -> Result<(), Error>
Load basic info settings from the provided byte slice
Sourcepub fn store_persist<S>(&self, persist: &mut Persist<S>) -> Result<(), Error>where
S: KvBlobStoreAccess,
pub fn store_persist<S>(&self, persist: &mut Persist<S>) -> Result<(), Error>where
S: KvBlobStoreAccess,
Store the basic info settings via the provided Persist instance
§Arguments
persist: thePersistinstance to serialize the settings into
Deliberately outlined (inline(never)): the settings’ TLV
serialization is sizeable, and every runtime-mutable-attribute setter
ends with this call - sharing a single copy keeps it out of each
attribute-dispatch path (flash size).
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 basic info settings from the provided BLOB store
§Arguments
store: the BLOB store to load the fabrics frombuf: a temporary buffer to use for loading the fabrics
Trait Implementations§
Source§impl Clone for BasicInfoSettings
impl Clone for BasicInfoSettings
Source§fn clone(&self) -> BasicInfoSettings
fn clone(&self) -> BasicInfoSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BasicInfoSettings
impl Debug for BasicInfoSettings
Source§impl Default for BasicInfoSettings
impl Default for BasicInfoSettings
Source§fn default() -> BasicInfoSettings
fn default() -> BasicInfoSettings
impl Eq for BasicInfoSettings
Source§impl<'__from_tlv> FromTLV<'__from_tlv> for BasicInfoSettings
impl<'__from_tlv> FromTLV<'__from_tlv> for BasicInfoSettings
Source§fn from_tlv(
element: &TLVElement<'__from_tlv>,
) -> Result<BasicInfoSettings, Error>
fn from_tlv( element: &TLVElement<'__from_tlv>, ) -> Result<BasicInfoSettings, Error>
Source§fn init_from_tlv(
element: TLVElement<'__from_tlv>,
) -> impl Init<BasicInfoSettings, Error>
fn init_from_tlv( element: TLVElement<'__from_tlv>, ) -> impl Init<BasicInfoSettings, 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 Hash for BasicInfoSettings
impl Hash for BasicInfoSettings
Source§impl PartialEq for BasicInfoSettings
impl PartialEq for BasicInfoSettings
impl StructuralPartialEq for BasicInfoSettings
Source§impl ToTLV for BasicInfoSettings
impl ToTLV for BasicInfoSettings
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.Source§impl<'__from_tlv> TryFrom<&TLVElement<'__from_tlv>> for BasicInfoSettings
impl<'__from_tlv> TryFrom<&TLVElement<'__from_tlv>> for BasicInfoSettings
Source§fn try_from(
element: &TLVElement<'__from_tlv>,
) -> Result<BasicInfoSettings, <BasicInfoSettings as TryFrom<&TLVElement<'__from_tlv>>>::Error>
fn try_from( element: &TLVElement<'__from_tlv>, ) -> Result<BasicInfoSettings, <BasicInfoSettings as TryFrom<&TLVElement<'__from_tlv>>>::Error>
Auto Trait Implementations§
impl Freeze for BasicInfoSettings
impl RefUnwindSafe for BasicInfoSettings
impl Send for BasicInfoSettings
impl Sync for BasicInfoSettings
impl Unpin for BasicInfoSettings
impl UnsafeUnpin for BasicInfoSettings
impl UnwindSafe for BasicInfoSettings
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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