SessionState

Enum SessionState 

Source
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

Source

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.

Source

pub const fn can_send_as_esme(self, command: CommandId) -> bool

Determines whether the current session state allows sending a given SMPP command as an ESME.

§Arguments
  • command - The SMPP command to check.
§Returns true if an ESME in that state can send this command.

This follows the 2.4 Operation Matrix of the SMPP 5.0 specification

Source

pub const fn can_receive_as_esme(self, command: CommandId) -> bool

Determines whether the current session state allows an ESME to receive a given SMPP command.

§Arguments
  • command - The SMPP command to check.
§Returns true if an ESME in that state can receive this command.

This follows the 2.4 Operation Matrix of the SMPP 5.0 specification

Source

pub const fn can_send_as_mc(self, command: CommandId) -> bool

Determines whether the current session state allows a MC to send a given SMPP command.

§Arguments
  • command - The SMPP command to check.
§Returns true if a MC in that state can send this command.

This follows the 2.4 Operation Matrix of the SMPP 5.0 specification

Source

pub const fn can_receive_as_mc(self, command: CommandId) -> bool

Determines whether the current session state allows a MC to receive a given SMPP command.

§Arguments
  • command - The SMPP command to check.
§Returns true if a MC in that state can receive this command.

This follows the 2.4 Operation Matrix of the SMPP 5.0 specification

Trait Implementations§

Source§

impl Clone for SessionState

Source§

fn clone(&self) -> SessionState

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionState

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for SessionState

Source§

fn default() -> SessionState

Returns the “default value” for a type. Read more
Source§

impl Hash for SessionState

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for SessionState

Source§

fn cmp(&self, other: &SessionState) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for SessionState

Source§

fn eq(&self, other: &SessionState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for SessionState

Source§

fn partial_cmp(&self, other: &SessionState) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for SessionState

Source§

impl Eq for SessionState

Source§

impl StructuralPartialEq for SessionState

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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