[][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.


impl<P> DecodeOptions<P> where
    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(
    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.


let decode_options = yenc::DecodeOptions::new("/tmp/decoded");


  • 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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.