pub struct NetCtlState {
pub network_id: Vec<u8, rs_matter::::dm::networks::wireless::OwnedWirelessNetworkId::{constant#0}>,
pub networking_status: Option<NetworkCommissioningStatusEnum>,
pub connect_error_value: Option<i32>,
}Expand description
A type holding the status of the last connect or scan operation for the NetCtlWithStatus NetCtl + NetCtlStatus implementation.
Fields§
§network_id: Vec<u8, rs_matter::::dm::networks::wireless::OwnedWirelessNetworkId::{constant#0}>The network ID used in the last scan or connect operation
networking_status: Option<NetworkCommissioningStatusEnum>The status of the last scan or connect operation
connect_error_value: Option<i32>The error code of the last scan or connect operation.
If the last operation was scan, this value is None.
Implementations§
Source§impl NetCtlState
impl NetCtlState
Sourcepub const fn new() -> NetCtlState
pub const fn new() -> NetCtlState
Create a new, empty instance of NetCtlState.
Sourcepub fn init() -> impl Init<NetCtlState>
pub fn init() -> impl Init<NetCtlState>
Return an in-place initializer for a new, empty NetCtlState.
Sourcepub const fn new_with_mutex() -> Mutex<RefCell<NetCtlState>>
pub const fn new_with_mutex() -> Mutex<RefCell<NetCtlState>>
Create a new, empty instance of NetCtlState wrapped in a mutex.
Sourcepub fn init_with_mutex() -> impl Init<Mutex<RefCell<NetCtlState>>>
pub fn init_with_mutex() -> impl Init<Mutex<RefCell<NetCtlState>>>
Return an in-place initializer for a new, empty NetCtlState wrapped in a mutex.
Sourcepub fn is_prov_ready(&self) -> bool
pub fn is_prov_ready(&self) -> bool
Return true if the network ID is set and the last operation was successful.
Sourcepub fn update<R>(
&mut self,
network_id: Option<&[u8]>,
result: Result<R, NetCtlError>,
) -> Result<R, NetCtlError>
pub fn update<R>( &mut self, network_id: Option<&[u8]>, result: Result<R, NetCtlError>, ) -> Result<R, NetCtlError>
Update the state with the provided network ID and result of the last operation.
Return the result of the last operation.
Sourcepub fn update_with_mutex<R>(
state: &Mutex<RefCell<NetCtlState>>,
network_id: Option<&[u8]>,
result: Result<R, NetCtlError>,
) -> Result<R, NetCtlError>
pub fn update_with_mutex<R>( state: &Mutex<RefCell<NetCtlState>>, network_id: Option<&[u8]>, result: Result<R, NetCtlError>, ) -> Result<R, NetCtlError>
Update the state with the provided network ID and result of the last operation.
Return the result of the last operation.
Sourcepub async fn wait_prov_ready(state: &Mutex<RefCell<NetCtlState>>, _btp: &Btp)
pub async fn wait_prov_ready(state: &Mutex<RefCell<NetCtlState>>, _btp: &Btp)
A utility to wait for provisioning over BTP to be ready.
Provisioning over BTP is considered complete when there is no longer an active connection
and the network ID is set (i.e. method NetCtl::connect was called successfully).
This method is only useful for non-concurrent commisioning using wireless networks and BLE,
and is likely to be used together with NoopWirelessNetCtl.
Trait Implementations§
Source§impl Default for NetCtlState
impl Default for NetCtlState
Source§fn default() -> NetCtlState
fn default() -> NetCtlState
Auto Trait Implementations§
impl Freeze for NetCtlState
impl RefUnwindSafe for NetCtlState
impl Send for NetCtlState
impl Sync for NetCtlState
impl Unpin for NetCtlState
impl UnsafeUnpin for NetCtlState
impl UnwindSafe for NetCtlState
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