pub enum AsciiStrError {
InvalidAscii,
TooLong {
capacity: usize,
length: usize,
},
CorruptedData,
}Expand description
Errors returned by AsciiStr operations.
Variants§
InvalidAscii
Input contained non-ASCII characters.
TooLong
Input exceeded the fixed capacity N.
Fields
CorruptedData
Internal data is corrupted or violates the type invariant.
This can occur when:
- The bytes are not valid UTF-8 (should never happen for ASCII data).
- Non-zero bytes appear after the first nul byte (violates the “nul-terminated + trailing zeros” representation invariant).
This variant exists only to keep the public API 100% panic-free. It is unreachable when the type is constructed through the safe API.
Trait Implementations§
Source§impl Clone for AsciiStrError
impl Clone for AsciiStrError
Source§fn clone(&self) -> AsciiStrError
fn clone(&self) -> AsciiStrError
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 moreSource§impl Debug for AsciiStrError
impl Debug for AsciiStrError
Source§impl Display for AsciiStrError
impl Display for AsciiStrError
Source§impl PartialEq for AsciiStrError
impl PartialEq for AsciiStrError
Source§fn eq(&self, other: &AsciiStrError) -> bool
fn eq(&self, other: &AsciiStrError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for AsciiStrError
impl Eq for AsciiStrError
impl StructuralPartialEq for AsciiStrError
Auto Trait Implementations§
impl Freeze for AsciiStrError
impl RefUnwindSafe for AsciiStrError
impl Send for AsciiStrError
impl Sync for AsciiStrError
impl Unpin for AsciiStrError
impl UnsafeUnpin for AsciiStrError
impl UnwindSafe for AsciiStrError
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.