pub struct LineReader<R> { /* private fields */ }
Expand description

Buffered non-blocking reader that returns only complete lines.

Implementations§

source§

impl<R: Read + AsRawFd + Debug> LineReader<R>

source

pub fn new(reader: R) -> Result<Self, Error>

Creates a new LineReader, setting the underlying descriptor as non-blocking.

source§

impl<R: Read + Debug> LineReader<R>

source

pub fn from_nonblocking(reader: R) -> Result<Self, Error>

Creates a new LineReader.

Assumes the reader is already non-blocking, not configuring anything in the underlying descriptor.

Trait Implementations§

source§

impl<R: AsFd> AsFd for LineReader<R>

source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
source§

impl<R: AsRawFd> AsRawFd for LineReader<R>

source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
source§

impl<R: Debug> Debug for LineReader<R>

source§

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

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

impl<R: Read + Debug> LineRead for LineReader<R>

source§

fn eof(&self) -> bool

Returns true if we have already reached EOF in the underlying Read object. Read more
source§

fn read_once(&mut self) -> Result<bool, Error>

Performs a single read operation on the underlying Read object. Read more
source§

fn lines_get(&mut self) -> Vec<String>

Returns the internal line buffer. Read more
source§

fn has_lines(&mut self) -> bool

Returns true if there are complete lines in the internal buffer. Read more
source§

fn read_available(&mut self) -> Result<(), Error>

Reads all available data into the internal line buffer, or at least until a complete line is available. Read more
source§

impl<R: AsFd + Read + Debug> LineReadFd for LineReader<R>

source§

impl<R: AsFd + AsRawFd + Read + Debug> LineReadRawAndFd for LineReader<R>

source§

impl<R: AsRawFd + Read + Debug> LineReadRawFd for LineReader<R>

Auto Trait Implementations§

§

impl<R> RefUnwindSafe for LineReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for LineReader<R>
where R: Send,

§

impl<R> Sync for LineReader<R>
where R: Sync,

§

impl<R> Unpin for LineReader<R>
where R: Unpin,

§

impl<R> UnwindSafe for LineReader<R>
where R: UnwindSafe,

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more