pub enum Encoder {
Hex,
Base64,
Windows1252,
Utf8,
Utf16le,
Utf16be,
}Variants§
Implementations§
Source§impl Encoder
impl Encoder
pub fn from_optional_str(encoding: Option<&str>) -> Result<Self, String>
pub fn from_str(encoding: &str) -> Result<Self, String>
pub fn encode_to_string( &self, bytes: &[u8], lossy: bool, ) -> Result<String, String>
pub fn encode(&self, bytes: &[u8]) -> Result<Vec<u8>, String>
pub fn decode<'a, T: Into<Cow<'a, [u8]>>>( &self, bytes: T, ) -> Result<Vec<u8>, String>
pub fn decode_from_string(&self, string: String) -> Result<Vec<u8>, String>
pub fn as_label(&self) -> &str
Trait Implementations§
impl StructuralPartialEq for Encoder
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
impl UnwindSafe for Encoder
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