Struct Session
pub struct Session<'a> {
kind: SessionType,
aid: Option<Prefixed<u8, &'a [u8]>>,
}Expand description
Session of a request (uim_session_information_type_v01).
Fields§
§kind: SessionType§aid: Option<Prefixed<u8, &'a [u8]>>Implementations§
§impl<'a> Session<'a>
impl<'a> Session<'a>
pub const MAX_AID_LEN: usize = 32
pub const MAX_AID_LEN: usize = 32
Maximum length of an application identifier in bytes
(QMI_UIM_AID_MAX_V01).
pub const fn new(kind: SessionType) -> Self
pub const fn new(kind: SessionType) -> Self
Returns a session without an application identifier.
pub fn with_aid(kind: SessionType, aid: &'a [u8]) -> Result<Self, Error>
pub fn with_aid(kind: SessionType, aid: &'a [u8]) -> Result<Self, Error>
Returns a session for the application aid.
Only sessions that specify an application use it, such as
SessionType::NONPROVISIONING_SLOT_1.
§Errors
Returns Error::AidTooLong if aid has more than
Self::MAX_AID_LEN bytes.
pub const fn aid(&self) -> &'a [u8] ⓘ
pub const fn aid(&self) -> &'a [u8] ⓘ
Returns the application identifier. It is empty if the session has none.
pub const fn kind(&self) -> SessionType
pub const fn kind(&self) -> SessionType
Returns the kind of the session.
Trait Implementations§
impl<'a> Copy for Session<'a>
impl<'a> Eq for Session<'a>
impl<'a> StructuralPartialEq for Session<'a>
Auto Trait Implementations§
impl<'a> Freeze for Session<'a>
impl<'a> RefUnwindSafe for Session<'a>
impl<'a> Send for Session<'a>
impl<'a> Sync for Session<'a>
impl<'a> Unpin for Session<'a>
impl<'a> UnsafeUnpin for Session<'a>
impl<'a> UnwindSafe for Session<'a>
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
Mutably borrows from an owned value. Read more