pub struct Parameters<'msg> { /* private fields */ }
Expand description

All the parameters of an IrcMsg.

Implementations§

source§

impl<'msg> Parameters<'msg>

source

pub const fn parse(input: &'msg [u8]) -> Result<Option<Self>, ParametersError>

Generates Parameters from a slice of bytes.

§Errors

Will return Err if the input contains an invalid character as per the IRC Client Protocol Specification.

source

pub const fn count(&self) -> usize

Returns the amount of parameters in Parameters.

source

pub const fn content(&self) -> ContentType<'_>

Returns all the parameters as a ContentType.

This includes the : before the last parameter if present.

source

pub const fn extract_first(&self) -> ContentType<'_>

Returns the first parameter as a ContentType.

Does not include : for the trailing parameter.

source

pub const fn extract_last(&self) -> ContentType<'_>

Returns the last parameter as a ContentType.

Does not include : for the trailing parameter.

source

pub const fn extract_specific( &self, target_index: usize ) -> Option<ContentType<'_>>

Returns the requested parameter as a ContentType at the specified index.

Index starts at 0. If out of bounds it returns None. Does not include : for the trailing parameter.

source

pub const fn is_valid_uft8(&self) -> bool

Checks whether the Parameters contains non-utf8 bytes.

Trait Implementations§

source§

impl<'msg> Clone for Parameters<'msg>

source§

fn clone(&self) -> Parameters<'msg>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'msg> Debug for Parameters<'msg>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'msg> Display for Parameters<'msg>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'msg> PartialEq for Parameters<'msg>

source§

fn eq(&self, other: &Parameters<'msg>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'msg> Copy for Parameters<'msg>

source§

impl<'msg> Eq for Parameters<'msg>

source§

impl<'msg> StructuralPartialEq for Parameters<'msg>

Auto Trait Implementations§

§

impl<'msg> Freeze for Parameters<'msg>

§

impl<'msg> RefUnwindSafe for Parameters<'msg>

§

impl<'msg> Send for Parameters<'msg>

§

impl<'msg> Sync for Parameters<'msg>

§

impl<'msg> Unpin for Parameters<'msg>

§

impl<'msg> UnwindSafe for Parameters<'msg>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.