pub struct SMSDeliver;Implementations§
Source§impl SMSDeliver
impl SMSDeliver
Sourcepub fn decode(data: &str) -> Result<SmsDeliverDecoded>
pub fn decode(data: &str) -> Result<SmsDeliverDecoded>
Decodes an SMS-DELIVER TP-DU.
Examples found in repository?
examples/decode_sms.rs (line 45)
40fn example_detailed_api() {
41 println!("--- Example 2: Detailed API ---");
42
43 let pdu = "07916407058099F9040B916407950303F100008921222140140004D4E2940A";
44
45 match SmsDeliver::decode(pdu) {
46 Ok(sms) => {
47 if let Some(ref number) = sms.smsc.number {
48 println!("SMSC Number: {}", number);
49 }
50 if let Some(ref toa) = sms.smsc.toa {
51 println!("SMSC TON: {}", toa.ton);
52 println!("SMSC NPI: {}", toa.npi);
53 }
54 println!();
55 println!("Sender Number: {}", sms.sender.number);
56 println!("Sender TON: {}", sms.sender.toa.ton);
57 println!();
58 println!("Message Type: {}", sms.header.mti);
59 println!("Has UDH: {}", sms.header.udhi);
60 println!("More Messages: {}", sms.header.mms);
61 println!();
62 println!("Protocol ID: {}", sms.pid);
63 println!("Encoding: {}", sms.dcs.encoding);
64 println!();
65 println!("Timestamp: {}", sms.scts);
66 println!("Timestamp (RFC3339): {}", sms.scts.to_rfc3339());
67 println!();
68 println!("Message: {}", sms.user_data.data);
69 println!("Has Header: {}", sms.user_data.header.is_some());
70 }
71 Err(e) => eprintln!("Error: {}", e),
72 }
73 println!();
74}Auto Trait Implementations§
impl Freeze for SMSDeliver
impl RefUnwindSafe for SMSDeliver
impl Send for SMSDeliver
impl Sync for SMSDeliver
impl Unpin for SMSDeliver
impl UnwindSafe for SMSDeliver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more