pub struct Prefix {
pub nick: String,
pub user: Option<String>,
pub host: Option<String>,
}
Expand description
Representation of a parsed message source. This is in the format nick [ [ “!” user ] “@” host ].
let prefix = "nick!user@host".parse::<simple_irc::Prefix>().unwrap();
assert_eq!(&prefix.nick[..], "nick");
assert_eq!(prefix.user.as_deref(), Some("user"));
assert_eq!(prefix.host.as_deref(), Some("host"));
Fields§
§nick: String
§user: Option<String>
§host: Option<String>
Implementations§
Trait Implementations§
impl StructuralPartialEq for Prefix
Auto Trait Implementations§
impl Freeze for Prefix
impl RefUnwindSafe for Prefix
impl Send for Prefix
impl Sync for Prefix
impl Unpin for Prefix
impl UnwindSafe for Prefix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more