pub struct Client { /* private fields */ }Expand description
SMPP Client.
The client is a handle to communicate with the SMPP server through a managed connection in the background.
When all clients are dropped, an Unbind command is sent to the server, and the connection is closed.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ConnectionBuilder
pub fn builder() -> ConnectionBuilder
Creates a new SMPP connection builder.
Sourcepub fn session_state(&self) -> SessionState
pub fn session_state(&self) -> SessionState
Returns the current session state of the client.
Sourcepub fn sequence_number(&self) -> u32
pub fn sequence_number(&self) -> u32
Returns the current sequence number of the client.
Sourcepub async fn submit_sm(
&self,
submit_sm: impl Into<SubmitSm>,
) -> Result<SubmitSmResp, Error>
pub async fn submit_sm( &self, submit_sm: impl Into<SubmitSm>, ) -> Result<SubmitSmResp, Error>
Sends an SubmitSm command to the server and waits for a successful SubmitSmResp.
Sourcepub async fn deliver_sm_resp(
&self,
sequence_number: u32,
deliver_sm_resp: impl Into<DeliverSmResp>,
) -> Result<(), Error>
pub async fn deliver_sm_resp( &self, sequence_number: u32, deliver_sm_resp: impl Into<DeliverSmResp>, ) -> Result<(), Error>
Sends a DeliverSmResp command to the server.
Sourcepub async fn unbind(&self) -> Result<(), Error>
pub async fn unbind(&self) -> Result<(), Error>
Sends an Unbind command to the server and waits for an UnbindResp and terminates the connection.
- The
UnbindRespstatus is not checked, the connection is closed regardless of the response status. - If the
UnbindResptimes out, the connection is closed anyway.
Sourcepub async fn generic_nack(&self, sequence_number: u32) -> Result<(), Error>
pub async fn generic_nack(&self, sequence_number: u32) -> Result<(), Error>
Sends a GenericNack command to the server.
Sourcepub async fn terminated(&self)
pub async fn terminated(&self)
Wait for the connection to be terminated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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