Enum const_irc_message_parser::command::Command
source · pub enum Command<'msg> {
Named(&'msg str),
Numeric(&'msg str),
}Expand description
The command of an IrcMsg.
Variants§
Named(&'msg str)
A Command in the form of a word.
Numeric(&'msg str)
A 3 digit number represented as a string.
Implementations§
source§impl<'msg> Command<'msg>
impl<'msg> Command<'msg>
sourcepub const fn parse(
input: &'msg [u8],
params_amount: usize
) -> Result<Self, CommandError<'_>>
pub const fn parse( input: &'msg [u8], params_amount: usize ) -> Result<Self, CommandError<'_>>
Generates a Command from a slice of bytes and number of Parameters.
Errors
Will return Err if the input is empty, contains anything but ascii alphanumeric characters,
is an unsupported Named/Numeric command or is provided too few parameters.
Please file a bug report if you want to add support for a missing Named/Numeric
command or the parameters required are too low.
Trait Implementations§
source§impl<'msg> PartialEq for Command<'msg>
impl<'msg> PartialEq for Command<'msg>
impl<'msg> Copy for Command<'msg>
impl<'msg> Eq for Command<'msg>
impl<'msg> StructuralEq for Command<'msg>
impl<'msg> StructuralPartialEq for Command<'msg>
Auto Trait Implementations§
impl<'msg> RefUnwindSafe for Command<'msg>
impl<'msg> Send for Command<'msg>
impl<'msg> Sync for Command<'msg>
impl<'msg> Unpin for Command<'msg>
impl<'msg> UnwindSafe for Command<'msg>
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