pub enum InvalidText {
Char(char),
Utf8 {
valid_up_to: usize,
error_len: Option<usize>,
},
MismatchedCapacity {
bound: Boundary1d,
value: Option<usize>,
limit: Option<usize>,
},
}Expand description
๐ฉ+
๐
An error composite of InvalidChar + InvalidUtf8 + MismatchedCapacity.
๐ text
Used in methods of:
StringNonul, and StringU*.
Variantsยง
Char(char)
๐ ๐ฉ An invalid given character was found.
Utf8
๐ฉ Invalid UTF-8 found while interpreting a byte sequence.
This is basically a replication of core::str::Utf8Error`.
MismatchedCapacity
๐ฉ The operation did not satisfy a finite capacity constraint.
Implementationsยง
Sourceยงimpl InvalidText
impl InvalidText
Sourcepub const fn from_invalid_char(_f: InvalidChar) -> InvalidText
pub const fn from_invalid_char(_f: InvalidChar) -> InvalidText
const
method equivalent to From<InvalidChar> for InvalidText.
Sourceยงimpl InvalidText
impl InvalidText
Sourcepub const fn from_invalid_utf8(_f: InvalidUtf8) -> InvalidText
pub const fn from_invalid_utf8(_f: InvalidUtf8) -> InvalidText
const
method equivalent to From<InvalidUtf8> for InvalidText.
Sourceยงimpl InvalidText
impl InvalidText
Sourcepub const fn from_mismatched_capacity(_f: MismatchedCapacity) -> InvalidText
pub const fn from_mismatched_capacity(_f: MismatchedCapacity) -> InvalidText
const
method equivalent to From<MismatchedCapacity> for InvalidText.
Sourceยงimpl InvalidText
impl InvalidText
Sourcepub const fn from_utf8_error(from: Utf8Error) -> InvalidText
pub const fn from_utf8_error(from: Utf8Error) -> InvalidText
Converts core::strUtf8Error to InvalidText::Utf8 in compile-time.
Trait Implementationsยง
Sourceยงimpl Clone for InvalidText
impl Clone for InvalidText
Sourceยงfn clone(&self) -> InvalidText
fn clone(&self) -> InvalidText
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 InvalidText
Sourceยงimpl Debug for InvalidText
impl Debug for InvalidText
Sourceยงimpl Display for InvalidText
impl Display for InvalidText
impl Eq for InvalidText
Sourceยงimpl Error for InvalidText
impl Error for InvalidText
1.30.0 ยท Sourceยงfn source(&self) -> Option<&(dyn Error + 'static)> โ
fn source(&self) -> Option<&(dyn Error + 'static)> โ
Returns the lower-level source of this error, if any. Read more
1.0.0 ยท Sourceยงfn description(&self) -> &str โ
fn description(&self) -> &str โ
๐Deprecated since 1.42.0:
use the Display impl or to_string()
Sourceยงimpl From<InvalidChar> for InvalidText
impl From<InvalidChar> for InvalidText
Sourceยงfn from(_f: InvalidChar) -> InvalidText
fn from(_f: InvalidChar) -> InvalidText
Converts to this type from the input type.
Sourceยงimpl From<InvalidText> for TextError
impl From<InvalidText> for TextError
Sourceยงfn from(f: InvalidText) -> TextError
fn from(f: InvalidText) -> TextError
Converts to this type from the input type.
Sourceยงimpl From<InvalidUtf8> for InvalidText
impl From<InvalidUtf8> for InvalidText
Sourceยงfn from(_f: InvalidUtf8) -> InvalidText
fn from(_f: InvalidUtf8) -> InvalidText
Converts to this type from the input type.
Sourceยงimpl From<MismatchedCapacity> for InvalidText
impl From<MismatchedCapacity> for InvalidText
Sourceยงfn from(_f: MismatchedCapacity) -> InvalidText
fn from(_f: MismatchedCapacity) -> InvalidText
Converts to this type from the input type.
Sourceยงimpl From<Utf8Error> for InvalidText
impl From<Utf8Error> for InvalidText
Sourceยงimpl Hash for InvalidText
impl Hash for InvalidText
Sourceยงimpl PartialEq for InvalidText
impl PartialEq for InvalidText
Sourceยงfn eq(&self, other: &InvalidText) -> bool
fn eq(&self, other: &InvalidText) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for InvalidText
Sourceยงimpl TryFrom<InvalidText> for InvalidChar
impl TryFrom<InvalidText> for InvalidChar
Sourceยงtype Error = FailedErrorConversion
type Error = FailedErrorConversion
The type returned in the event of a conversion error.
Sourceยงfn try_from(_f: InvalidText) -> Result<InvalidChar, Self::Error> โ
fn try_from(_f: InvalidText) -> Result<InvalidChar, Self::Error> โ
Performs the conversion.
Sourceยงimpl TryFrom<InvalidText> for InvalidUtf8
impl TryFrom<InvalidText> for InvalidUtf8
Sourceยงtype Error = FailedErrorConversion
type Error = FailedErrorConversion
The type returned in the event of a conversion error.
Sourceยงfn try_from(_f: InvalidText) -> Result<InvalidUtf8, Self::Error> โ
fn try_from(_f: InvalidText) -> Result<InvalidUtf8, Self::Error> โ
Performs the conversion.
Sourceยงimpl TryFrom<InvalidText> for MismatchedCapacity
impl TryFrom<InvalidText> for MismatchedCapacity
Sourceยงtype Error = FailedErrorConversion
type Error = FailedErrorConversion
The type returned in the event of a conversion error.
Sourceยงfn try_from(_f: InvalidText) -> Result<MismatchedCapacity, Self::Error> โ
fn try_from(_f: InvalidText) -> Result<MismatchedCapacity, Self::Error> โ
Performs the conversion.
Sourceยงimpl TryFrom<TextError> for InvalidText
impl TryFrom<TextError> for InvalidText
Sourceยงtype Error = FailedErrorConversion
type Error = FailedErrorConversion
The type returned in the event of a conversion error.
Sourceยงfn try_from(f: TextError) -> Result<InvalidText, FailedErrorConversion> โ
fn try_from(f: TextError) -> Result<InvalidText, FailedErrorConversion> โ
Performs the conversion.
Auto Trait Implementationsยง
impl Freeze for InvalidText
impl RefUnwindSafe for InvalidText
impl Send for InvalidText
impl Sync for InvalidText
impl Unpin for InvalidText
impl UnsafeUnpin for InvalidText
impl UnwindSafe for InvalidText
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
Returns a deterministic hash of the
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
Available on crate feature
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
The alignment of this type in bytes.
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Returns the alignment of this type in bytes.
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Know whether dropping values of this type matters, in compile-time.
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Returns the minimum alignment of the type in bytes. Read more
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Returns the alignment of the pointed-to value in bytes. Read more
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Returns the size of a type in bytes. Read more
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Returns the size of the pointed-to value in bytes. Read more
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
Returns
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
Forgets about
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
Available on crate feature
unsafe_layout only.Returns the value of type
T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
Available on crate feature
unsafe_layout only.Returns the value of type
T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
Available on crate feature
unsafe_slice only.