[−][src]Struct ezmsg::Msg
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]
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,