pub enum SessionState {
Closed,
Open,
BoundTx,
BoundRx,
BoundTrx,
Outbound,
Unbound,
}Expand description
The SessionState represents the state of an ESME session in the SMPP 5.0 protocol.
The session state determines what operations are allowed at any given point in the communication between an ESME (External Short Message Entity) and an MC (Message Center).
The session state transitions are triggered by bind, unbind, and outbind operations.
Variants§
Closed
CLOSED state.
This is the initial state before any connection is established. In this state, no communication is possible between the ESME and MC.
Open
OPEN state.
This state is entered after a connection is established between
the ESME and MC, but before any SMPP bind operation is performed.
In this state, only bind operations are allowed.
BoundTx
BOUND_TX state (Transmitter mode).
This state is entered after a successful bind_transmitter operation. In this state, the ESME can send messages to the MC but cannot receive messages.
BoundRx
BOUND_RX state (Receiver mode).
This state is entered after a successful bind_receiver operation. In this state, the ESME can receive messages from the MC but cannot send messages.
BoundTrx
BOUND_TRX state (Transceiver mode).
This state is entered after a successful bind_transceiver operation. In this state, the ESME can both send messages to and receive messages from the MC.
Outbound
OUTBOUND state.
This state is entered after an MC initiates an outbind operation to an ESME. The ESME must respond with a bind_receiver or bind_transceiver operation. In this state, no messaging operations are allowed until the ESME completes the binding process.
Unbound
UNBOUND state.
This state is entered after an unbind operation is initiated by either the ESME or MC. The session is in the process of being terminated, but the unbind_resp has not yet been sent. No messaging operations are allowed in this state.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub const fn is_bound(self) -> bool
pub const fn is_bound(self) -> bool
Returns true if the session is a bound state.
One of the following states:
SessionState::BoundTx, SessionState::BoundRx or SessionState::BoundTrx.
Sourcepub const fn can_send_as_esme(self, command: CommandId) -> bool
pub const fn can_send_as_esme(self, command: CommandId) -> bool
Sourcepub const fn can_receive_as_esme(self, command: CommandId) -> bool
pub const fn can_receive_as_esme(self, command: CommandId) -> bool
Sourcepub const fn can_send_as_mc(self, command: CommandId) -> bool
pub const fn can_send_as_mc(self, command: CommandId) -> bool
Sourcepub const fn can_receive_as_mc(self, command: CommandId) -> bool
pub const fn can_receive_as_mc(self, command: CommandId) -> bool
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more