[−][src]Struct simple_irc::Message
A structural representation of an IRC message.
Note that this library does not guarantee that messages will be preserved byte-for-byte, but all messages will have the same semantic meaning.
// use std::convert::FromStr; let msg = "HELLO world".parse::<simple_irc::Message>().unwrap(); assert_eq!(msg.tags.len(), 0); assert_eq!(msg.prefix, None); assert_eq!(&msg.command[..], "HELLO"); assert_eq!(msg.params.len(), 1); assert_eq!(&msg.params[0][..], "world"); assert_eq!(&msg.to_string(), "HELLO :world");
Fields
prefix: Option<Prefix>
command: String
params: Vec<String>
Methods
impl Message
[src]
pub fn new(command: String, params: Vec<String>) -> Self
[src]
pub fn new_with_all(
tags: BTreeMap<String, String>,
prefix: Option<Prefix>,
command: String,
params: Vec<String>
) -> Self
[src]
tags: BTreeMap<String, String>,
prefix: Option<Prefix>,
command: String,
params: Vec<String>
) -> Self
pub fn new_with_prefix(
command: String,
params: Vec<String>,
prefix: Prefix
) -> Self
[src]
command: String,
params: Vec<String>,
prefix: Prefix
) -> Self
Trait Implementations
impl Clone for Message
[src]
impl Debug for Message
[src]
impl Default for Message
[src]
impl Display for Message
[src]
impl FromStr for Message
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(input: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<Message> for Message
[src]
impl StructuralPartialEq for Message
[src]
Auto Trait Implementations
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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>,