pub enum ServerMessageParseError {
MismatchedCommand(IRCMessage),
MissingTag(IRCMessage, &'static str),
MissingTagValue(IRCMessage, &'static str),
MalformedTagValue(IRCMessage, &'static str, String),
MissingParameter(IRCMessage, usize),
MalformedChannel(IRCMessage),
MalformedParameter(IRCMessage, usize),
MissingPrefix(IRCMessage),
MissingNickname(IRCMessage),
}
Expand description
Errors encountered while trying to parse an IRC message as a more specialized “server message”, based on its IRC command.
Variants§
MismatchedCommand(IRCMessage)
That command’s data is not parsed by this implementation
This type of error is only returned if you use try_from
directly on a special
server message implementation, instead of the general ServerMessage::try_from
which covers all implementations and does not emit this type of error.
MissingTag(IRCMessage, &'static str)
No tag present under key key
MissingTagValue(IRCMessage, &'static str)
No tag value present under key key
MalformedTagValue(IRCMessage, &'static str, String)
Malformed tag value for tag key
, value was value
MissingParameter(IRCMessage, usize)
No parameter found at index n
MalformedChannel(IRCMessage)
Malformed channel parameter (#
must be present + something after it)
MalformedParameter(IRCMessage, usize)
Malformed parameter at index n
MissingPrefix(IRCMessage)
Missing prefix altogether
MissingNickname(IRCMessage)
No nickname found in prefix
Trait Implementations§
Source§impl Debug for ServerMessageParseError
impl Debug for ServerMessageParseError
Source§impl Display for ServerMessageParseError
impl Display for ServerMessageParseError
Source§impl Error for ServerMessageParseError
impl Error for ServerMessageParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ServerMessageParseError> for IRCMessage
impl From<ServerMessageParseError> for IRCMessage
Source§fn from(msg: ServerMessageParseError) -> IRCMessage
fn from(msg: ServerMessageParseError) -> IRCMessage
Converts to this type from the input type.
Source§impl PartialEq for ServerMessageParseError
impl PartialEq for ServerMessageParseError
impl Eq for ServerMessageParseError
impl StructuralPartialEq for ServerMessageParseError
Auto Trait Implementations§
impl Freeze for ServerMessageParseError
impl RefUnwindSafe for ServerMessageParseError
impl Send for ServerMessageParseError
impl Sync for ServerMessageParseError
impl Unpin for ServerMessageParseError
impl UnwindSafe for ServerMessageParseError
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more