Struct yenc::DecodeOptions [−][src]
pub struct DecodeOptions<P> { /* fields omitted */ }
Options for decoding. The entry point for decoding from a file or (TCP) stream to an output directory.
Methods
impl<P> DecodeOptions<P> where
P: AsRef<Path>,
[src]
impl<P> DecodeOptions<P> where
P: AsRef<Path>,
pub fn new(output_dir: P) -> DecodeOptions<P>
[src]
pub fn new(output_dir: P) -> DecodeOptions<P>
Construct new DecodeOptions using the specified path as output directory. The output directory is
pub fn decode_file(&self, input_filename: &str) -> Result<String, DecodeError>
[src]
pub fn decode_file(&self, input_filename: &str) -> Result<String, DecodeError>
Decodes the input file in a new output file.
If ok, returns the path of the decoded file.
Example
let decode_options = yenc::DecodeOptions::new("/tmp/decoded"); decode_options.decode_file("test2.bin.yenc");
Errors
- when the output file already exists
- when I/O error occurs
pub fn decode_stream<R>(&self, read_stream: R) -> Result<String, DecodeError> where
R: Read,
[src]
pub fn decode_stream<R>(&self, read_stream: R) -> Result<String, DecodeError> where
R: Read,
Decodes the data from a stream to the specified directory.
Writes the output to a file with the filename from the header line, and places it in the output path. The path of the output file is returned as String.
Trait Implementations
impl<P: Debug> Debug for DecodeOptions<P>
[src]
impl<P: Debug> Debug for DecodeOptions<P>
Auto Trait Implementations
impl<P> Send for DecodeOptions<P> where
P: Send,
impl<P> Send for DecodeOptions<P> where
P: Send,
impl<P> Sync for DecodeOptions<P> where
P: Sync,
impl<P> Sync for DecodeOptions<P> where
P: Sync,