[][src]Struct ezmsg::Msg

pub struct Msg { /* fields omitted */ }

Implementations

impl Msg[src]

pub fn new() -> Self[src]

Create a new message object, with an unset topic.

Note that a message object without a topic is invalid. set_topic must be called to set a topic to make the message object valid.

pub fn new_topic(topic: &str) -> Result<Self, Error>[src]

Create a new mesage object with a topic.

pub fn get_params(&self) -> &HashMap<String, String>[src]

Get a reference to the internal HashMap.

pub fn set_topic(&mut self, topic: &str) -> Result<(), Error>[src]

Set topic for message.

Overwrites current topic is one has already been set.

pub fn get_topic(&self) -> Option<&str>[src]

Get a reference to the topic string, or None if topic is not been set.

pub fn add_param<T: ToString, U: ToString>(&mut self, key: T, value: U)[src]

Add a parameter to the message.

pub fn add_str<T: ToString, U: ToString>(&mut self, key: T, value: U)[src]

Add a string parameter to the message.

pub fn get_param(&self, key: &str) -> Option<&str>[src]

pub fn get_str(&self, key: &str) -> Option<&str>[src]

pub fn get_int<T: FromStr>(&self, key: &str) -> Result<T, Error>[src]

pub fn serialize(&self) -> Result<Vec<u8>, Error>[src]

pub fn clear(&mut self)[src]

pub fn into_params(self) -> HashMap<String, String>[src]

Consume the Msg buffer and return the internal parameters HashMap.

Trait Implementations

impl Clone for Msg[src]

impl Debug for Msg[src]

impl Default for Msg[src]

impl Display for Msg[src]

Auto Trait Implementations

impl RefUnwindSafe for Msg

impl Send for Msg

impl Sync for Msg

impl Unpin for Msg

impl UnwindSafe for Msg

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.