[−][src]Struct twitch_irc::message::IRCMessage
A protocol-level IRC message, with arbitrary command, parameters, tags and prefix.
See RFC 2812, section 2.3.1 for the message format that this is based on. Further, this implements IRCv3 tags.
Fields
A map of additional key-value tags on this message.
prefix: Option<IRCPrefix>
The "prefix" of this message, as defined by RFC 2812. Typically specifies the sending server and/or user.
command: String
A command like PRIVMSG
or 001
(see RFC 2812 for the definition).
params: Vec<String>
A list of parameters on this IRC message. See RFC 2812 for the definition.
Middle parameters and trailing parameters are treated the same here, and as long as there are no spaces in the last parameter, there is no way to tell if that parameter was a middle or trailing parameter when it was parsed.
Implementations
impl IRCMessage
[src]
pub fn new_simple(command: String, params: Vec<String>) -> IRCMessage
[src]
Create a new IRCMessage
with just a command and parameters, similar to the
irc!
macro.
pub fn new(
tags: IRCTags,
prefix: Option<IRCPrefix>,
command: String,
params: Vec<String>
) -> IRCMessage
[src]
tags: IRCTags,
prefix: Option<IRCPrefix>,
command: String,
params: Vec<String>
) -> IRCMessage
Create a new IRCMessage
by specifying all fields.
pub fn parse(source: &str) -> Result<IRCMessage, IRCParseError>
[src]
Parse a raw IRC wire-format message into an IRCMessage
. source
should be specified
without trailing newline character(s).
Trait Implementations
impl AsRawIRC for IRCMessage
[src]
fn format_as_raw_irc(&self, f: &mut Formatter<'_>) -> Result
[src]
fn as_raw_irc(&self) -> String where
Self: Sized,
[src]
Self: Sized,
impl Clone for IRCMessage
[src]
fn clone(&self) -> IRCMessage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for IRCMessage
[src]
impl From<ClearChatMessage> for IRCMessage
[src]
fn from(msg: ClearChatMessage) -> IRCMessage
[src]
impl From<ClearMsgMessage> for IRCMessage
[src]
fn from(msg: ClearMsgMessage) -> IRCMessage
[src]
impl From<GlobalUserStateMessage> for IRCMessage
[src]
fn from(msg: GlobalUserStateMessage) -> IRCMessage
[src]
impl From<HostTargetMessage> for IRCMessage
[src]
fn from(msg: HostTargetMessage) -> IRCMessage
[src]
impl From<JoinMessage> for IRCMessage
[src]
fn from(msg: JoinMessage) -> IRCMessage
[src]
impl From<NoticeMessage> for IRCMessage
[src]
fn from(msg: NoticeMessage) -> IRCMessage
[src]
impl From<PartMessage> for IRCMessage
[src]
fn from(msg: PartMessage) -> IRCMessage
[src]
impl From<PingMessage> for IRCMessage
[src]
fn from(msg: PingMessage) -> IRCMessage
[src]
impl From<PongMessage> for IRCMessage
[src]
fn from(msg: PongMessage) -> IRCMessage
[src]
impl From<PrivmsgMessage> for IRCMessage
[src]
fn from(msg: PrivmsgMessage) -> IRCMessage
[src]
impl From<ReconnectMessage> for IRCMessage
[src]
fn from(msg: ReconnectMessage) -> IRCMessage
[src]
impl From<RoomStateMessage> for IRCMessage
[src]
fn from(msg: RoomStateMessage) -> IRCMessage
[src]
impl From<ServerMessage> for IRCMessage
[src]
fn from(msg: ServerMessage) -> IRCMessage
[src]
impl From<ServerMessageParseError> for IRCMessage
[src]
fn from(msg: ServerMessageParseError) -> IRCMessage
[src]
impl From<UserNoticeMessage> for IRCMessage
[src]
fn from(msg: UserNoticeMessage) -> IRCMessage
[src]
impl From<UserStateMessage> for IRCMessage
[src]
fn from(msg: UserStateMessage) -> IRCMessage
[src]
impl From<WhisperMessage> for IRCMessage
[src]
fn from(msg: WhisperMessage) -> IRCMessage
[src]
impl PartialEq<IRCMessage> for IRCMessage
[src]
fn eq(&self, other: &IRCMessage) -> bool
[src]
fn ne(&self, other: &IRCMessage) -> bool
[src]
impl StructuralPartialEq for IRCMessage
[src]
impl TryFrom<IRCMessage> for ClearChatMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<ClearChatMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<ClearChatMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for ClearMsgMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<ClearMsgMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<ClearMsgMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for ReconnectMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<ReconnectMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<ReconnectMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for RoomStateMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<RoomStateMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<RoomStateMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for UserNoticeMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<UserNoticeMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<UserNoticeMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for UserStateMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<UserStateMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<UserStateMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for WhisperMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<WhisperMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<WhisperMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for ServerMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<ServerMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<ServerMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for GlobalUserStateMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<GlobalUserStateMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<GlobalUserStateMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for HostTargetMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<HostTargetMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<HostTargetMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for JoinMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(source: IRCMessage) -> Result<JoinMessage, ServerMessageParseError>
[src]
impl TryFrom<IRCMessage> for NoticeMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<NoticeMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<NoticeMessage, ServerMessageParseError>
impl TryFrom<IRCMessage> for PartMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(source: IRCMessage) -> Result<PartMessage, ServerMessageParseError>
[src]
impl TryFrom<IRCMessage> for PingMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(source: IRCMessage) -> Result<PingMessage, ServerMessageParseError>
[src]
impl TryFrom<IRCMessage> for PongMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(source: IRCMessage) -> Result<PongMessage, ServerMessageParseError>
[src]
impl TryFrom<IRCMessage> for PrivmsgMessage
[src]
type Error = ServerMessageParseError
The type returned in the event of a conversion error.
fn try_from(
source: IRCMessage
) -> Result<PrivmsgMessage, ServerMessageParseError>
[src]
source: IRCMessage
) -> Result<PrivmsgMessage, ServerMessageParseError>
Auto Trait Implementations
impl RefUnwindSafe for IRCMessage
impl Send for IRCMessage
impl Sync for IRCMessage
impl Unpin for IRCMessage
impl UnwindSafe for IRCMessage
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> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,