#[non_exhaustive]pub enum OpaqueReason {
InvalidUtf8,
OddLengthUtf16,
InvalidUtf16,
}Expand description
Why a byte stream was kept opaque instead of being decoded as text.
#[non_exhaustive]: more failure reasons may be added in future releases, so match with a
wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidUtf8
The bytes were not valid UTF-8.
OddLengthUtf16
A UTF-16 stream had an odd number of bytes, so it could not be split into 16-bit units.
InvalidUtf16
The 16-bit units did not form valid UTF-16 (for example an unpaired surrogate).
Trait Implementations§
Source§impl Clone for OpaqueReason
impl Clone for OpaqueReason
Source§fn clone(&self) -> OpaqueReason
fn clone(&self) -> OpaqueReason
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OpaqueReason
Source§impl Debug for OpaqueReason
impl Debug for OpaqueReason
impl Eq for OpaqueReason
Source§impl PartialEq for OpaqueReason
impl PartialEq for OpaqueReason
impl StructuralPartialEq for OpaqueReason
Auto Trait Implementations§
impl Freeze for OpaqueReason
impl RefUnwindSafe for OpaqueReason
impl Send for OpaqueReason
impl Sync for OpaqueReason
impl Unpin for OpaqueReason
impl UnsafeUnpin for OpaqueReason
impl UnwindSafe for OpaqueReason
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