Struct sbd::mo::Message
[−]
[src]
pub struct Message { /* fields omitted */ }
A mobile-origined Iridium SBD message.
Message
s can be ordered by time of session.
Methods
impl Message
[src]
fn from_path<P: AsRef<Path>>(path: P) -> Result<Message>
Reads in a message from a file path.
Examples
use sbd::mo::Message; let message = Message::from_path("data/0-mo.sbd").unwrap();
fn read_from<R: Read>(readable: R) -> Result<Message>
Reads in a message from an object that implements Read
.
Per the specification, oversized and undersized messages will result in an error.
Examples
use std::fs::File; use sbd::mo::Message; let mut file = File::open("data/0-mo.sbd").unwrap(); let message = Message::read_from(file).unwrap();
fn write_to<W: Write>(&self, w: &mut W) -> Result<()>
Write this message back to a object that can Write
.
Examples
use std::io::Cursor; use sbd::mo::Message; let message = Message::from_path("data/0-mo.sbd").unwrap(); let mut cursor = Cursor::new(Vec::new()); message.write_to(&mut cursor);
fn protocol_revision_number(&self) -> u8
Returns this message's protocol revision number.
fn imei(&self) -> &str
Returns this message's IMEI number as a string.
fn cdr_reference(&self) -> u32
Returns this message's cdr reference number (also called auto id).
fn session_status(&self) -> SessionStatus
Returns this message's session status.
fn momsn(&self) -> u16
Returns this message's mobile originated message number.
fn mtmsn(&self) -> u16
Returns this message's mobile terminated message number.
fn time_of_session(&self) -> DateTime<Utc>
Returns this message's time of session.
fn payload_ref(&self) -> &Vec<u8>
Returns a reference to this message's payload.
fn payload_str(&self) -> Result<&str>
Returns this message's payload as a str.
Trait Implementations
impl Clone for Message
[src]
fn clone(&self) -> Message
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Message
[src]
impl Eq for Message
[src]
impl PartialEq for Message
[src]
fn eq(&self, __arg_0: &Message) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Message) -> bool
This method tests for !=
.
impl Default for Message
[src]
impl PartialOrd for Message
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Message
[src]
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
ord_max_min
)Compares and returns the minimum of two values. Read more