pub struct TryReserveError { /* private fields */ }Expand description
The error type for try_reserve methods.
This error is returned when memory allocation fails or when the capacity exceeds collection-specific limits.
Implementations§
Source§impl TryReserveError
impl TryReserveError
Sourcepub fn kind(&self) -> TryReserveErrorKind
pub fn kind(&self) -> TryReserveErrorKind
Returns the kind of allocation error that occurred.
Trait Implementations§
Source§impl Clone for TryReserveError
impl Clone for TryReserveError
Source§fn clone(&self) -> TryReserveError
fn clone(&self) -> TryReserveError
Returns a duplicate of the value. Read more
1.0.0 · 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 TryReserveError
impl Debug for TryReserveError
Source§impl Display for TryReserveError
impl Display for TryReserveError
Source§impl Error for TryReserveError
Implements the standard error trait for TryReserveError.
impl Error for TryReserveError
Implements the standard error trait for TryReserveError.
This enables using this error type with standard error handling mechanisms.
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<LayoutError> for TryReserveError
impl From<LayoutError> for TryReserveError
Source§fn from(_: LayoutError) -> Self
fn from(_: LayoutError) -> Self
Always evaluates to a TryReserveError with TryReserveErrorKind::CapacityOverflow.
This conversion is used when a layout error occurs during allocation.
Source§impl From<TryReserveErrorKind> for TryReserveError
impl From<TryReserveErrorKind> for TryReserveError
Source§fn from(kind: TryReserveErrorKind) -> Self
fn from(kind: TryReserveErrorKind) -> Self
Creates a TryReserveError from a TryReserveErrorKind.
Source§impl PartialEq for TryReserveError
impl PartialEq for TryReserveError
impl Eq for TryReserveError
impl StructuralPartialEq for TryReserveError
Auto Trait Implementations§
impl Freeze for TryReserveError
impl RefUnwindSafe for TryReserveError
impl Send for TryReserveError
impl Sync for TryReserveError
impl Unpin for TryReserveError
impl UnwindSafe for TryReserveError
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