Skip to main content

LinesSource

Struct LinesSource 

Source
pub struct LinesSource<R: BufRead> { /* private fields */ }
Expand description

A line-delimited reader as a source.

Implementations§

Source§

impl<R: BufRead> LinesSource<R>

Source

pub fn new(reader: R, format: LineFormat) -> LinesSource<R>

Source

pub fn limits(self, limits: Limits) -> Self

Source

pub fn abort(self, abort: AbortFlag) -> Self

Source

pub fn metrics(self, metrics: Arc<Metrics>) -> Self

Source

pub fn chunk_bytes(self, bytes: usize) -> Self

The CSV chunk size; a chunk closes at the first record boundary at or past it. Zero closes a chunk at every record.

Source

pub fn run_owned<S: Sink + Send + 'static>( self, sink: S, ) -> (Result<Flow, Fail>, S)

Run with an owned sink: JSON Lines through the rule-event adapter (lexemes kept), CSV through the walk. The sink comes back.

Source

pub fn run_boxed( self, sink: Box<dyn Sink + Send>, ) -> (Result<Flow, Fail>, Box<dyn Sink + Send>)

LinesSource::run_owned for a boxed sink.

Trait Implementations§

Source§

impl<R: BufRead> Source for LinesSource<R>

Source§

fn run(self, sink: &mut dyn Sink) -> Result<Flow, Fail>

Both formats through the walk; JSON Lines numbers carry no lexeme on this path (see LinesSource::run_owned).

Auto Trait Implementations§

§

impl<R> !RefUnwindSafe for LinesSource<R>

§

impl<R> !UnwindSafe for LinesSource<R>

§

impl<R> Freeze for LinesSource<R>
where R: Freeze,

§

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

§

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

§

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

§

impl<R> UnsafeUnpin for LinesSource<R>
where R: UnsafeUnpin,

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.