pub enum Input {
Text(String),
Bytes(Vec<u8>),
}Expand description
Raw input handed to a Decoder: source text or source bytes.
Text codecs take Input::Text; binary codecs take Input::Bytes. A text
codec given bytes interprets them as UTF-8 (see Input::into_string).
Variants§
Implementations§
Source§impl Input
impl Input
Sourcepub fn into_string(self) -> Result<String>
pub fn into_string(self) -> Result<String>
Take the input as UTF-8 text, decoding Input::Bytes and failing closed
with a codec error if the bytes are not valid UTF-8.
Trait Implementations§
impl Eq for Input
impl StructuralPartialEq for Input
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Input
impl UnwindSafe for Input
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more