[−][src]Struct streamson_lib::handler::file::File
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 createdErr(_)
- 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("/tmp/output.txt") .unwrap() .set_use_path(true);
pub fn set_separator<S>(self, separator: S) -> Self where
S: ToString,
[src]
S: ToString,
Trait Implementations
impl Handler for File
[src]
fn use_path(&self) -> bool
[src]
fn separator(&self) -> &str
[src]
fn handle(
&mut self,
path: &Path,
_matcher_idx: usize,
data: Option<&[u8]>
) -> Result<(), Handler>
[src]
&mut self,
path: &Path,
_matcher_idx: usize,
data: Option<&[u8]>
) -> Result<(), Handler>
fn handle_idx(
&mut self,
_path: &Path,
_matcher_idx: usize,
_idx: Output
) -> Result<(), Handler>
[src]
&mut self,
_path: &Path,
_matcher_idx: usize,
_idx: Output
) -> Result<(), Handler>
fn buffering_required(&self) -> bool
[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]
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>,