Skip to main content

SubmitRequest

Struct SubmitRequest 

Source
pub struct SubmitRequest {
Show 17 fields pub smsc: Option<String>, pub smsc_toa: Option<u8>, pub destination: String, pub destination_toa: Option<u8>, pub body: Body, pub alphabet: Option<Alphabet>, pub locking_shift: Vec<Language>, pub single_shift: Vec<Language>, pub class: Option<u8>, pub pid: u8, pub message_ref: u8, pub status_report: bool, pub reject_duplicates: bool, pub reply_path: bool, pub validity: Option<Validity>, pub concat_ref: Option<u16>, pub concat_16bit: bool,
}
Expand description

Everything an SMS-SUBMIT needs. SubmitRequest::new(to, text) gives the usual defaults: no SMSC (modem’s), auto alphabet, MR 0, no VP, no status report, no concatenation reference (set one for text that may not fit one part).

Fields§

§smsc: Option<String>

SMSC address; None or empty → 00 (use the one stored in the modem).

§smsc_toa: Option<u8>

TOA for the SMSC; default 0x91 with a leading +, else 0x81.

§destination: String

+ + digits (international), digits / * / # (unknown TON) or text (alphanumeric, up to 11 GSM 7-bit characters). Set destination_toa to send the semi-octets a b c as digits.

§destination_toa: Option<u8>

TOA override for the destination (e.g. super::TOA_NATIONAL). TON 5 forces alphanumeric encoding.

§body: Body§alphabet: Option<Alphabet>

Force an alphabet; None picks GSM 7-bit, then national tables from locking_shift/single_shift (if that avoids UCS2), then UCS2.

§locking_shift: Vec<Language>

National locking shift tables the recipient supports (23.038 §6.2.1.2.4).

§single_shift: Vec<Language>

National single shift tables the recipient supports.

§class: Option<u8>§pid: u8§message_ref: u8§status_report: bool§reject_duplicates: bool§reply_path: bool§validity: Option<Validity>§concat_ref: Option<u16>

Concatenation reference (23.040 §9.2.3.24.1), required when the message needs more than one part: encode_submit returns PduError::MissingConcatRef without it. It must differ between long messages to the same recipient that may be in flight together, or the receiver can merge their parts; senders keep a counter (modulo 256, or 65536 with concat_16bit) per recipient or globally. Values above 255 imply a 16-bit reference IE.

§concat_16bit: bool

Implementations§

Source§

impl SubmitRequest

Source

pub fn new(destination: impl Into<String>, text: impl Into<String>) -> Self

Trait Implementations§

Source§

impl Clone for SubmitRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SubmitRequest

Source§

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

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

impl Default for SubmitRequest

Source§

fn default() -> Self

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

impl Eq for SubmitRequest

Source§

impl PartialEq for SubmitRequest

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SubmitRequest

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, 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.