pub struct GSM;Expand description
— GSM 7-bit Codec —
Implementations§
Source§impl GSM
impl GSM
Sourcepub fn decode(data: &str, strip_padding: bool) -> Result<String>
pub fn decode(data: &str, strip_padding: bool) -> Result<String>
Returns decoded message from PDU string.
Examples found in repository?
examples/decode_sms.rs (line 82)
76fn example_codecs() {
77 println!("--- Example 3: Direct Codec Usage ---");
78
79 // GSM 7-bit
80 println!("GSM 7-bit decoding:");
81 let gsm_hex = "C8F71D14969741F977FD07";
82 match Gsm7Bit::decode(gsm_hex, false) {
83 Ok(text) => println!(" '{}' -> '{}'", gsm_hex, text),
84 Err(e) => eprintln!(" Error: {}", e),
85 }
86
87 // Another GSM 7-bit example
88 let gsm_hex2 = "D4E2940A";
89 match Gsm7Bit::decode(gsm_hex2, false) {
90 Ok(text) => println!(" '{}' -> '{}'", gsm_hex2, text),
91 Err(e) => eprintln!(" Error: {}", e),
92 }
93
94 println!();
95
96 // UCS2
97 println!("UCS2 (Unicode) decoding:");
98 let ucs2_hex = "004C006F00720065006D00200049007000730075006D";
99 match Ucs2::decode(ucs2_hex) {
100 Ok(text) => println!(" '{}' -> '{}'", ucs2_hex, text),
101 Err(e) => eprintln!(" Error: {}", e),
102 }
103
104 println!();
105}Auto Trait Implementations§
impl Freeze for GSM
impl RefUnwindSafe for GSM
impl Send for GSM
impl Sync for GSM
impl Unpin for GSM
impl UnwindSafe for GSM
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