pub struct Command<'a, const N: usize> {
pub status: CommandStatus,
pub sequence_number: u32,
/* private fields */
}Expand description
SMPP command.
The following PDU example illustrates how a SMPP PDU is decoded:
Sample PDU (Values are shown in Hex format):
00 00 00 2F 00 00 00 02 00 00 00 00 00 00 00 01
53 4D 50 50 33 54 45 53 54 00 73 65 63 72 65 74
30 38 00 53 55 42 4D 49 54 31 00 50 01 01 00
The 16-octet header would be decoded as follows:
| Octets | Description |
|---|---|
| 00 00 00 2F | Command Length (47) |
| 00 00 00 02 | Command ID (bind_transmitter) |
| 00 00 00 00 | Command Status (0) |
| 00 00 00 01 | Sequence Number (1) |
The remaining data represents the PDU body (which in this example relates to the bind_transmitter PDU). This is diagnosed as follows:
| Octets | Value |
|---|---|
| 53 4D 50 50 33 54 45 53 54 00 | system_id (“SMPP3TEST”) |
| 73 65 63 72 65 74 30 38 00 | password (“secret08”) |
| 53 55 42 4D 49 54 31 00 | system_type (“SUBMIT1”) |
| 50 | interface_version (0x50 “V5.0 compliant”) |
| 01 | addr_ton (0x01) |
| 01 | addr_npi (0x01) |
| 00 | addr_range (NULL) |
Fields§
§status: CommandStatusSee CommandStatus
sequence_number: u32The sequence_number represents a means of uniquely
identifying each PDU within a SMPP session. It also provides a means of correlating request
and response PDUs based on matching sequence number.
Implementations§
Source§impl<'a, const N: usize> Command<'a, N>
impl<'a, const N: usize> Command<'a, N>
Sourcepub fn into_parts(self) -> CommandParts<'a, N>
pub fn into_parts(self) -> CommandParts<'a, N>
Converts Self into its parts.
Sourcepub fn from_parts(parts: CommandParts<'a, N>) -> Self
pub fn from_parts(parts: CommandParts<'a, N>) -> Self
Source§impl<'a, const N: usize> Command<'a, N>
impl<'a, const N: usize> Command<'a, N>
pub fn new( status: CommandStatus, sequence_number: u32, pdu: impl Into<Pdu<'a, N>>, ) -> Self
pub const fn new_const( status: CommandStatus, sequence_number: u32, pdu: Pdu<'a, N>, ) -> Self
pub const fn id(&self) -> CommandId
pub const fn status(&self) -> CommandStatus
pub const fn sequence_number(&self) -> u32
pub const fn pdu(&self) -> Option<&Pdu<'a, N>>
pub fn set_pdu(&mut self, pdu: impl Into<Pdu<'a, N>>)
pub fn builder() -> CommandStatusBuilder<'a, N>
Trait Implementations§
Source§impl<'a, 'arbitrary: 'a, const N: usize> Arbitrary<'arbitrary> for Command<'a, N>
impl<'a, 'arbitrary: 'a, const N: usize> Arbitrary<'arbitrary> for Command<'a, N>
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<'a, const N: usize> DecodeWithLength<'a> for Command<'a, N>
impl<'a, const N: usize> DecodeWithLength<'a> for Command<'a, N>
Source§impl<'buf, const N: usize> Encoder<Command<'buf, N>> for CommandCodec<N>
Available on crate feature framez only.
impl<'buf, const N: usize> Encoder<Command<'buf, N>> for CommandCodec<N>
Available on crate feature
framez only.Source§impl<'a, const N: usize> Ord for Command<'a, N>
impl<'a, const N: usize> Ord for Command<'a, N>
Source§impl<'a, const N: usize> PartialOrd for Command<'a, N>
impl<'a, const N: usize> PartialOrd for Command<'a, N>
impl<'a, const N: usize> Eq for Command<'a, N>
impl<'a, const N: usize> StructuralPartialEq for Command<'a, N>
Auto Trait Implementations§
impl<'a, const N: usize> Freeze for Command<'a, N>
impl<'a, const N: usize> RefUnwindSafe for Command<'a, N>
impl<'a, const N: usize> Send for Command<'a, N>
impl<'a, const N: usize> Sync for Command<'a, N>
impl<'a, const N: usize> Unpin for Command<'a, N>
impl<'a, const N: usize> UnwindSafe for Command<'a, N>
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)