Skip to main content

Client

Struct Client 

pub struct Client {
    qmi: Client<Uim>,
}
Expand description

Client of the UIM service.

Its Connection must run for requests to complete. Cloning the client is cheap. Dropping every clone stops the connection.

Fields§

§qmi: Client<Uim>

Implementations§

§

impl Client

pub const fn builder() -> ClientBuilder<Uim, Self>

Returns a builder for the client, for example to change the request timeout.

pub fn card_status(&self) -> RequestBuilder<'_, CardStatus>

Reads the status of all card slots. Sends GetCardStatus.

pub fn event_reg( &self, request: &EventReg, ) -> RequestBuilder<'_, RegisteredEvents>

Sets which indications the modem sends to this client. Sends EventReg.

pub fn events(&self) -> Result<Indications<StatusChange>, Error>

Subscribes to card status changes.

Only indications received after this call are delivered. Subscribe before you enable them with Client::event_reg, otherwise the first ones are lost.

§Errors

Returns ql_qmi::Error::Disconnected if the connection has stopped.

pub const fn qmi(&self) -> &Client<Uim>

Returns the typed QMI client, for example to send a custom request.

pub fn read_iccid( &self, slot: Slot, ) -> RequestBuilder<'_, Transparent, Result<Iccid, Error>>

Reads the ICCID of the card in slot. Sends ReadTransparent::iccid.

§Errors

Returns the errors of Client::read_transparent, or Error::InvalidIccid if the file doesn’t contain a valid ICCID.

pub async fn read_imsi(&self) -> Result<Imsi, Error>

Reads the IMSI of the application in the primary GSM or UMTS session.

This sends GetCardStatus to find the type of the application, and then reads the file with ReadTransparent::imsi.

§Errors

Returns Error::NoPrimaryGwApp if the session has no application, an error if a request fails, or Error::InvalidImsi if the file doesn’t contain a valid IMSI.

pub fn read_transparent( &self, request: &ReadTransparent<'_>, ) -> RequestBuilder<'_, Transparent, Result<Transparent, Error>>

Reads a transparent file and checks the status word of the card. Sends ReadTransparent.

If the card refuses the read, it returns Error::Card with the status word instead of a plain rejection.

§Errors

Returns an error if the request fails, Error::Card if the card reports an error status word, or Error::NoContent if the response has no content.

Trait Implementations§

§

impl Clone for Client

§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Client

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl From<Client<Uim>> for Client

§

fn from(qmi: Client<Uim>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more