pub struct Config<E: Into<Box<dyn EncodingChecker>>, T: Into<Box<dyn Transform>>> { /* private fields */ }
Expand description
Configuration for processing. Two things can be set: encoding of input and type of line ending.
use std::io::Cursor;
use loe::{process, Config, Encoding, TransformMode};
let mut input = Cursor::new("hello\nworld!\n");
let expected = "hello\r\nworld!\r\n";
let mut output = Cursor::new(Vec::new());
process(&mut input, &mut output, Config::default().encoding(Encoding::Ascii).transform(TransformMode::Crlf));
let actual = String::from_utf8(output.into_inner()).unwrap();
assert_eq!(actual, expected);
Implementations
sourceimpl Config<Encoding, TransformMode>
impl Config<Encoding, TransformMode>
Trait Implementations
sourceimpl<E: Clone + Into<Box<dyn EncodingChecker>>, T: Clone + Into<Box<dyn Transform>>> Clone for Config<E, T>
impl<E: Clone + Into<Box<dyn EncodingChecker>>, T: Clone + Into<Box<dyn Transform>>> Clone for Config<E, T>
sourceimpl<E: Debug + Into<Box<dyn EncodingChecker>>, T: Debug + Into<Box<dyn Transform>>> Debug for Config<E, T>
impl<E: Debug + Into<Box<dyn EncodingChecker>>, T: Debug + Into<Box<dyn Transform>>> Debug for Config<E, T>
sourceimpl Default for Config<Encoding, TransformMode>
impl Default for Config<Encoding, TransformMode>
sourceimpl<E: PartialEq + Into<Box<dyn EncodingChecker>>, T: PartialEq + Into<Box<dyn Transform>>> PartialEq<Config<E, T>> for Config<E, T>
impl<E: PartialEq + Into<Box<dyn EncodingChecker>>, T: PartialEq + Into<Box<dyn Transform>>> PartialEq<Config<E, T>> for Config<E, T>
impl<E: Eq + Into<Box<dyn EncodingChecker>>, T: Eq + Into<Box<dyn Transform>>> Eq for Config<E, T>
impl<E: Into<Box<dyn EncodingChecker>>, T: Into<Box<dyn Transform>>> StructuralEq for Config<E, T>
impl<E: Into<Box<dyn EncodingChecker>>, T: Into<Box<dyn Transform>>> StructuralPartialEq for Config<E, T>
Auto Trait Implementations
impl<E, T> RefUnwindSafe for Config<E, T> where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<E, T> Send for Config<E, T> where
E: Send,
T: Send,
impl<E, T> Sync for Config<E, T> where
E: Sync,
T: Sync,
impl<E, T> Unpin for Config<E, T> where
E: Unpin,
T: Unpin,
impl<E, T> UnwindSafe for Config<E, T> where
E: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more