#[non_exhaustive]pub enum BytesError {
CapacityExceeded {
requested: usize,
max: usize,
},
}Available on crate features
types-bytes and types only.Expand description
字节容器的错误类型。未来可能新增变体/字段,请勿依赖穷尽匹配。
§Feature Requirement
需要启用 "types-bytes" 特性。
§Examples
use lib_unknown::types::bytes::{Bytes, StackBytes};
let mut b = StackBytes::<4>::new();
let err = b.extend_from_slice(b"toolong").unwrap_err();
assert!(matches!(err, lib_unknown::types::bytes::BytesError::CapacityExceeded { .. }));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.
Trait Implementations§
Source§impl Clone for BytesError
impl Clone for BytesError
impl Copy for BytesError
Source§impl Debug for BytesError
impl Debug for BytesError
Source§impl Display for BytesError
impl Display for BytesError
impl Eq for BytesError
Source§impl Error for BytesError
impl Error for BytesError
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 PartialEq for BytesError
impl PartialEq for BytesError
impl StructuralPartialEq for BytesError
Auto Trait Implementations§
impl Freeze for BytesError
impl RefUnwindSafe for BytesError
impl Send for BytesError
impl Sync for BytesError
impl Unpin for BytesError
impl UnsafeUnpin for BytesError
impl UnwindSafe for BytesError
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