[−][src]Struct yenc::DecodeOptions
Options for decoding. The entry point for decoding from a file or (TCP) stream to an output directory.
Implementations
impl<P> DecodeOptions<P> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
pub fn new(output_dir: P) -> DecodeOptions<P>
[src]
Construct new DecodeOptions using the specified path as output directory. The output directory is
pub fn decode_file(
&self,
input_filename: &str
) -> Result<Box<Path>, DecodeError>
[src]
&self,
input_filename: &str
) -> Result<Box<Path>, 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<Box<Path>, DecodeError> where
R: Read,
[src]
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
Auto Trait Implementations
impl<P> RefUnwindSafe for DecodeOptions<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for DecodeOptions<P> where
P: Send,
P: Send,
impl<P> Sync for DecodeOptions<P> where
P: Sync,
P: Sync,
impl<P> Unpin for DecodeOptions<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for DecodeOptions<P> where
P: UnwindSafe,
P: UnwindSafe,
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>,