Struct streamson_lib::handler::output::Output[][src]

pub struct Output<W> where
    W: Write
{ /* fields omitted */ }

File handler responsible for storing data to a file.

Implementations

impl<W> Output<W> where
    W: Write
[src]

pub fn new(output: W) -> Self[src]

Creates new Output handler

Arguments

  • output - structur which implements io::Write

pub fn set_write_path(self, write_path: bool) -> Self[src]

Set whether to show path

Arguments

  • use_path - should path be shown in the output

Example

use std::io::stdout;
use streamson_lib::handler;
let output = handler::Output::new(stdout())
    .set_write_path(true);

pub fn set_separator<S>(self, separator: S) -> Self where
    S: ToString
[src]

Set which separator will be used in the output

Note that every separator will be extended to every found item.

Arguments

  • separator - how found record will be separated

Example

use std::io::stdout;
use streamson_lib::handler;
let output = handler::Output::new(stdout())
    .set_separator("######\n");

Trait Implementations

impl FromStr for Output<File>[src]

type Err = Handler

The associated error which can be returned from parsing.

fn from_str(input: &str) -> Result<Self, Self::Err>[src]

Parses a string s to return a value of this type. Read more

impl<W> Handler for Output<W> where
    W: Write + Send + 'static, 
[src]

fn start(
    &mut self,
    path: &Path,
    _matcher_idx: usize,
    _token: Token
) -> Result<Option<Vec<u8>>, Handler>
[src]

Is called when a path is matched Read more

fn feed(
    &mut self,
    data: &[u8],
    _matcher_idx: usize
) -> Result<Option<Vec<u8>>, Handler>
[src]

Is called when handler receives some data Read more

fn end(
    &mut self,
    _path: &Path,
    _matcher_idx: usize,
    _token: Token
) -> Result<Option<Vec<u8>>, Handler>
[src]

Is called when the path is no longer matched Read more

fn as_any(&self) -> &dyn Any[src]

Function to allow downcasting

fn is_converter(&self) -> bool[src]

Should be handler used to convert data

Auto Trait Implementations

impl<W> RefUnwindSafe for Output<W> where
    W: RefUnwindSafe

impl<W> Send for Output<W> where
    W: Send

impl<W> Sync for Output<W> where
    W: Sync

impl<W> Unpin for Output<W> where
    W: Unpin

impl<W> UnwindSafe for Output<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.