[][src]Struct ellidri_reader::IrcReader

pub struct IrcReader<R> { /* fields omitted */ }

Asynchronous IRC message reader.

Methods

impl<R: AsyncRead> IrcReader<R>[src]

pub fn new(r: R, message_max: usize) -> Self[src]

Creates a new IrcReader with the given maximum length for messages.

Although message_max allows restriction on the message length, IrcReader will always allow lines of 4096 + message_max bytes if the line starts with @. This is because the message tag spec states that tags can occupy up to 4096 bytes. Thus, message_max designates the maximum length of a message without tags (should default to 512, see RFCs 1459 and 2812).

pub fn read_message<'a>(&'a mut self, buf: &'a mut String) -> ReadMessage<'a, R> where
    Self: Unpin
[src]

Equivalent of tokio's AsyncBufReadExt::read_line for IRC messages.

Function signature can also be read like so:

async fn read_message(&mut self, buf: &mut String) -> io::Result<usize>

Auto Trait Implementations

impl<R> RefUnwindSafe for IrcReader<R> where
    R: RefUnwindSafe

impl<R> Send for IrcReader<R> where
    R: Send

impl<R> Sync for IrcReader<R> where
    R: Sync

impl<R> Unpin for IrcReader<R> where
    R: Unpin

impl<R> UnwindSafe for IrcReader<R> where
    R: UnwindSafe

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, 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.