SmppField

Enum SmppField 

Source
pub enum SmppField {
Show 62 variants addr, addr_npi, addr_ton, address_range, area, data_coding, dest_addr_npi, dest_addr_ton, dest_address, destination_addr, dl_name, encoding_content_type, error_code, error_status_code, esm_class, esme_addr, esme_addr_npi, esme_addr_ton, final_date, format, id, interface_version, message_id, message_payload, message_state, ms_availability_status, network_type, no_unsuccess, number_of_dests, number_of_time_units, password, pdu, priority_flag, protocol_id, registered_delivery, replace_if_present_flag, sc_interface_version, schedule_delivery_time, sequence_number, service_type, session_number, short_message, sm_default_msg_id, sm_length, source_addr, source_addr_npi, source_addr_ton, status, system_id, system_type, tag, tlvs, type_of_network, unit, units_of_time, unsuccess_sme, user_message_reference, validity_behavior, validity_information, validity_period, value, value_length,
}
Expand description

Every field defined in the SMPP protocol and extra fields defined in this library.

Used for verbose error handling while decoding invalid pdus, if the verbose feature is enabled.

§Example

// bind_transmitter bytes
// The `password` field is not null terminated.
// The `decode` method will return an error with
// the `SmppField::password` field as a source in
// the sources tree.
let bytes: [u8; 46] = [
    // Header
    0x00, 0x00, 0x00, 0x2E, // Command Length (46 bytes total)
    0x00, 0x00, 0x00, 0x02, // Command ID (bind_transmitter)
    0x00, 0x00, 0x00, 0x00, // Command Status (0 - OK)
    0x00, 0x00, 0x00, 0x01, // Sequence Number (1)

    // system_id: "SMPP3TEST\0"
    0x53, 0x4D, 0x50, 0x50, 0x33, 0x54, 0x45, 0x53, 0x54, 0x00,
    // password: "secret08" WRONG! not null terminated!
    0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x30, 0x38,
    // system_type: "SUBMIT1"
    0x53, 0x55, 0x42, 0x4D, 0x49, 0x54, 0x31, 0x00,
    // interface_version
    0x50,
    // addr_ton
    0x01,
    // addr_npi
    0x01,
    // addr_range
    0x00,
];

let error = Command::decode(&bytes[4..], 46 - 4).unwrap_err();

assert!(error.field_exists(SmppField::password));

// Knowing that the `password` field is invalid,
// we can respond with `ESME_RINVPASWD` (Invalid Password).

Variants§

§

addr

§

addr_npi

§

addr_ton

§

address_range

§

area

§

data_coding

§

dest_addr_npi

§

dest_addr_ton

§

dest_address

§

destination_addr

§

dl_name

§

encoding_content_type

§

error_code

§

error_status_code

§

esm_class

§

esme_addr

§

esme_addr_npi

§

esme_addr_ton

§

final_date

§

format

§

id

§

interface_version

§

message_id

§

message_payload

§

message_state

§

ms_availability_status

§

network_type

§

no_unsuccess

§

number_of_dests

§

number_of_time_units

§

password

§

pdu

§

priority_flag

§

protocol_id

§

registered_delivery

§

replace_if_present_flag

§

sc_interface_version

§

schedule_delivery_time

§

sequence_number

§

service_type

§

session_number

§

short_message

§

sm_default_msg_id

§

sm_length

§

source_addr

§

source_addr_npi

§

source_addr_ton

§

status

§

system_id

§

system_type

§

tag

§

tlvs

§

type_of_network

§

unit

§

units_of_time

§

unsuccess_sme

§

user_message_reference

§

validity_behavior

§

validity_information

§

validity_period

§

value

§

value_length

Trait Implementations§

Source§

impl Clone for SmppField

Source§

fn clone(&self) -> SmppField

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SmppField

Source§

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

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

impl PartialEq for SmppField

Source§

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

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

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 Copy for SmppField

Source§

impl Eq for SmppField

Source§

impl StructuralPartialEq for SmppField

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

impl<T> From<T> for T

Source§

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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