[][src]Struct irc_rust::MessageBuilder

pub struct MessageBuilder<'a> { /* fields omitted */ }

A MessageBuilder for a simpler generation of a message instead of building an string first.

Implementations

impl<'a> Message<'a>[src]

pub fn new() -> Self[src]

Creates a new empty builder.

pub fn command(self, cmd: &'a str) -> Message<'a>[src]

Set the command.

pub fn tag(self, key: &'a str, value: &'a str) -> Message<'a>[src]

Set a tag.

pub fn prefix_name(self, name: &'a str) -> Message<'a>[src]

Set a prefix.

pub fn prefix_user(self, user: &'a str) -> Message<'a>[src]

Set a prefix.

pub fn prefix_host(self, host: &'a str) -> Message<'a>[src]

Set a prefix.

pub fn param(self, param: &'a str) -> Message<'a>[src]

Add a param.

pub fn set_param(self, index: usize, param: &'a str) -> Message<'a>[src]

Set a param at the given index. If the index is below 0, it won't be set. If index >= length of the existing parameters it will be added to the end but not set as trailing. This doesn't allow to set the trailing parameter.

pub fn trailing(self, trailing: &'a str) -> Message<'a>[src]

pub fn build(self) -> Result<Message, MessageBuildError>[src]

Create a Message instance and return if valid.

Trait Implementations

impl<'a> Clone for Message<'a>[src]

impl<'a> Debug for Message<'a>[src]

impl<'a> Default for Message<'a>[src]

impl<'a> Eq for Message<'a>[src]

impl<'a> PartialEq<Message<'a>> for Message<'a>[src]

impl<'a> StructuralEq for Message<'a>[src]

impl<'a> StructuralPartialEq for Message<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Message<'a>

impl<'a> Send for Message<'a>

impl<'a> Sync for Message<'a>

impl<'a> Unpin for Message<'a>

impl<'a> UnwindSafe for Message<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.