[][src]Struct yenc::DecodeOptions

pub struct DecodeOptions<P> { /* fields omitted */ }

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]

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]

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]

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]

Auto Trait Implementations

impl<P> RefUnwindSafe for DecodeOptions<P> where
    P: RefUnwindSafe

impl<P> Send for DecodeOptions<P> where
    P: Send

impl<P> Sync for DecodeOptions<P> where
    P: Sync

impl<P> Unpin for DecodeOptions<P> where
    P: Unpin

impl<P> UnwindSafe for DecodeOptions<P> where
    P: UnwindSafe

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.