pub struct Sessions { /* private fields */ }Expand description
All sessions
Implementations§
Source§impl Sessions
impl Sessions
pub fn get_next_sess_id(&mut self) -> u16
pub fn get_next_exch_id<C>(&mut self, crypto: C) -> Result<u16, Error>where
C: Crypto,
pub fn get_session_for_eviction(&mut self) -> Option<&mut Session>
pub fn add( &mut self, msg_ctr: u32, reserved: bool, peer_addr: Address, peer_nodeid: Option<u64>, dev_det: &BasicInfoConfig<'_>, ) -> Result<&mut Session, Error>
Sourcepub fn remove(&mut self, id: u32) -> Option<Session>
pub fn remove(&mut self, id: u32) -> Option<Session>
This assumes that the higher layer has taken care of doing anything required as per the spec before the session is removed
Sourcepub fn remove_for_fabric(
&mut self,
fabric_idx: NonZero<u8>,
expire_sess_id: Option<u32>,
)
pub fn remove_for_fabric( &mut self, fabric_idx: NonZero<u8>, expire_sess_id: Option<u32>, )
This assumes that the higher layer has taken care of doing anything required as per the spec before the sessions are removed or expired
pub fn get(&mut self, id: u32) -> Option<&mut Session>
Sourcepub fn remove_pase(&mut self, expire_sess_id: Option<u32>)
pub fn remove_pase(&mut self, expire_sess_id: Option<u32>)
Drop every PASE session, whether unpromoted (still
SessionMode::Pase { fab_idx: 0 }) or already promoted to a
fabric. Used by:
RevokeCommissioningand a fail-safe expiry over a PASE session (Matter Core spec): when the commissioning window is torn down, any in-flight PASE sessions associated with it must be terminated. A PASE that was promoted viaAddNOCis rolled back by the same fail-safe expiry, so its session must go too.CommissioningComplete(Matter Core spec): once the device transitions to operational state, all PASE sessions SHALL be terminated. Without this each commissioning round leaks the promoted PASE it ran on, and the session table eventually exhausts — visible asBUSYon the next round’sPBKDFParamRequest.
expire_sess_id is the optional ID of a session that should NOT
be removed immediately — typically the session that issued the
triggering command, so its response can still be sent. That
session is marked as expired instead, so it stops accepting
new exchanges but the in-flight one can complete; the transport
reclaims the slot via the usual LRU eviction path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sessions
impl RefUnwindSafe for Sessions
impl Send for Sessions
impl Sync for Sessions
impl Unpin for Sessions
impl UnsafeUnpin for Sessions
impl UnwindSafe for Sessions
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