[][src]Struct streamson_lib::handler::file::File

pub struct File { /* fields omitted */ }

File handler responsible for storing data to a file.

Implementations

impl File[src]

pub fn new(fs_path: &str) -> Result<Self, Handler>[src]

Creates new File handler

Arguments

  • fs_path - path to a file in the file system (will be truncated)

Returns

  • Ok(File) - Handler was successfully created
  • Err(_) - Failed to create handler

Errors

Error might occur when the file fails to open

pub fn set_use_path(self, use_path: bool) -> Self[src]

Set whether to show path

Arguments

  • use_path - should path be shown in the output

Example

use streamson_lib::handler;
let file = handler::File::new("output.txt")
    .unwrap()
    .set_use_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 streamson_lib::handler;
let file = handler::File::new("output.txt")
    .unwrap()
    .set_separator("######\n");

Trait Implementations

impl Handler for File[src]

Auto Trait Implementations

impl RefUnwindSafe for File

impl Send for File

impl Sync for File

impl Unpin for File

impl UnwindSafe for File

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.