pub struct ConnectionBuilder { /* private fields */ }Expand description
Builder for creating a new SMPP connection.
Implementations§
Source§impl ConnectionBuilder
impl ConnectionBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ConnectionBuilder.
Sourcepub async fn connect(
self,
host: impl ToSocketAddrs,
) -> Result<(Client, impl Stream<Item = Event> + Unpin + Debug + 'static), Error>
pub async fn connect( self, host: impl ToSocketAddrs, ) -> Result<(Client, impl Stream<Item = Event> + Unpin + Debug + 'static), Error>
Connects to the SMPP server and performs the bind operation.
Opens and manages a connection in the background and returns a client and an event stream.
- The client is used as a handle to communicate with the server through the managed connection.
- The event stream is used to receive events from the server, such as incoming messages or errors.
Sourcepub async fn connected<S>(
self,
stream: S,
) -> Result<(Client, impl Stream<Item = Event> + Unpin + Debug + 'static), Error>
pub async fn connected<S>( self, stream: S, ) -> Result<(Client, impl Stream<Item = Event> + Unpin + Debug + 'static), Error>
Performs the bind operation on an already connected stream.
Manages a connection in the background and returns a client and an event stream.
- The client is used as a handle to communicate with the server through the managed connection.
- The event stream is used to receive events from the server, such as incoming messages or errors.
Source§impl ConnectionBuilder
impl ConnectionBuilder
Sourcepub const fn max_command_length(self, max_command_length: usize) -> Self
pub const fn max_command_length(self, max_command_length: usize) -> Self
Sets the maximum command length for incoming commands.
Sourcepub const fn bind_mode(self, bind_mode: BindMode) -> Self
pub const fn bind_mode(self, bind_mode: BindMode) -> Self
Sets the bind mode for the connection.
Sourcepub const fn transmitter(self) -> Self
pub const fn transmitter(self) -> Self
Sets the bind mode to transmitter.
Sourcepub const fn transceiver(self) -> Self
pub const fn transceiver(self) -> Self
Sets the bind mode to transceiver (both transmitter and receiver).
Sourcepub fn system_id(self, system_id: COctetString<1, 16>) -> Self
pub fn system_id(self, system_id: COctetString<1, 16>) -> Self
Sets the system ID.
Sourcepub fn password(self, password: COctetString<1, 9>) -> Self
pub fn password(self, password: COctetString<1, 9>) -> Self
Sets the password.
Sourcepub fn system_type(self, system_type: COctetString<1, 13>) -> Self
pub fn system_type(self, system_type: COctetString<1, 13>) -> Self
Sets the system type.
Sourcepub fn address_range(self, address_range: COctetString<1, 41>) -> Self
pub fn address_range(self, address_range: COctetString<1, 41>) -> Self
Sets the address range.
Sourcepub fn enquire_link_interval(self, enquire_link_interval: Duration) -> Self
pub fn enquire_link_interval(self, enquire_link_interval: Duration) -> Self
Sets the enquire link interval.
Used to determine how often an enquire link command should be sent to the server.
Sourcepub fn response_timeout(self, response_timeout: Duration) -> Self
pub fn response_timeout(self, response_timeout: Duration) -> Self
Sets the response timeout.
This timeout is used to determine how long the client should wait for a response from the server.