Struct sbd::mo::Message [−][src]
pub struct Message { /* fields omitted */ }
Expand description
Error returned when there is no A mobile-origined Iridium SBD message.
Message
s can be ordered by time of session.
Implementations
Reads in a message from a file path.
Examples
use sbd::mo::Message;
let message = Message::from_path("data/0-mo.sbd").unwrap();
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();
Creates a new message from information elements.
Examples
extern crate chrono;
use chrono::{Utc, TimeZone};
use sbd::mo::{InformationElement, Header, SessionStatus, Message};
let header = InformationElement::Header(Header {
auto_id: 1,
imei: [0; 15],
session_status: SessionStatus::Ok,
momsn: 1,
mtmsn: 0,
time_of_session: Utc.ymd(2017, 10, 1).and_hms(0, 0, 0),
});
let payload = InformationElement::Payload(Vec::new());
let message = Message::new(vec![header, payload]);
Returns this message’s auto id.
Examples
use sbd::mo::Message;
let message = Message::from_path("data/0-mo.sbd").unwrap();
let auto_id = message.auto_id();
Returns this message’s session status.
Examples
use sbd::mo::Message;
let message = Message::from_path("data/0-mo.sbd").unwrap();
let session_status = message.session_status();
Returns this message’s mobile originated message sequence number.
Examples
use sbd::mo::Message;
let message = Message::from_path("data/0-mo.sbd").unwrap();
let momsn = message.momsn();
Returns this message’s mobile terminated message sequence number.
Examples
use sbd::mo::Message;
let message = Message::from_path("data/0-mo.sbd").unwrap();
let mtmsn = message.mtmsn();
Returns this message’s time of session.
Examples
use sbd::mo::Message;
let message = Message::from_path("data/0-mo.sbd").unwrap();
let time_of_session = message.time_of_session();
Returns this message’s payload.
Examples
use sbd::mo::Message;
let message = Message::from_path("data/0-mo.sbd").unwrap();
let payload = message.payload();
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);
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Message
impl UnwindSafe for Message
Blanket Implementations
Mutably borrows from an owned value. Read more