[−][src]Struct ellidri_reader::IrcReader
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]
Self: Unpin,
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,
R: RefUnwindSafe,
impl<R> Send for IrcReader<R> where
R: Send,
R: Send,
impl<R> Sync for IrcReader<R> where
R: Sync,
R: Sync,
impl<R> Unpin for IrcReader<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for IrcReader<R> where
R: UnwindSafe,
R: UnwindSafe,
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,
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, 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.
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>,