#[non_exhaustive]pub enum SmppField {
Show 65 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,
udh_length,
udh_id,
udh_value,
}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 mut bytes = BytesMut::from(&[
// 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(&mut bytes.split_off(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 (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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
udh_length
udh_id
udh_value
Trait Implementations§
impl Copy for SmppField
impl Eq for SmppField
impl StructuralPartialEq for SmppField
Auto Trait Implementations§
impl Freeze for SmppField
impl RefUnwindSafe for SmppField
impl Send for SmppField
impl Sync for SmppField
impl Unpin for SmppField
impl UnwindSafe for SmppField
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
Mutably borrows from an owned value. Read more
§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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)