Struct sbd::message::Message [] [src]

pub struct Message {
    // some fields omitted
}

A mobile-origined Iridium SBD message.

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::message::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::message::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::message::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.

Trait Implementations

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 Eq for Message
[src]

impl Debug for Message
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Default for Message
[src]

fn default() -> Message

Returns the "default value" for a type. Read more

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