Struct irc_rust::MessageBuilder [−][src]
A MessageBuilder for a simpler generation of a message instead of building an string first.
Implementations
impl<'a> Message<'a>
[src]
pub fn new(command: &'a str) -> Self
[src]
Creates a new empty builder.
pub fn command(self, cmd: &'a str) -> Message<'a>
[src]
pub fn tag(self, key: &'a str, value: &'a str) -> Message<'a>
[src]
pub fn prefix(
self,
name: &'a str,
user: Option<&'a str>,
host: Option<&'a str>
) -> Message<'a>
[src]
self,
name: &'a str,
user: Option<&'a str>,
host: Option<&'a str>
) -> Message<'a>
Set a prefix name.
Panics
Panics if name is empty, user or host == Some(“”) or user is some and host is none.
pub fn param(self, param: &'a str) -> Message<'a>
[src]
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.
Panics
Panics if param is empty.
pub fn remove_param(self, index: usize) -> Message<'a>
[src]
pub fn trailing(self, trailing: &'a str) -> Message<'a>
[src]
pub fn build(self) -> Message
[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]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,