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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionState
impl Debug for SessionState
Source§impl Default for SessionState
impl Default for SessionState
Source§fn default() -> SessionState
fn default() -> SessionState
Source§impl Hash for SessionState
impl Hash for SessionState
Source§impl Ord for SessionState
impl Ord for SessionState
Source§impl PartialEq for SessionState
impl PartialEq for SessionState
Source§impl PartialOrd for SessionState
impl PartialOrd for SessionState
impl Copy for SessionState
impl Eq for SessionState
impl StructuralPartialEq for SessionState
Auto Trait Implementations§
impl Freeze for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnwindSafe for SessionState
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)