pub enum BorrowErrorKind {
Show 15 variants
ConflictSharedExclusive,
ConflictExclusiveExclusive,
ReadWhileExclusivelyBorrowed,
WriteWhileBorrowed,
ReferenceEscape,
ReferenceStoredInArray,
ReferenceStoredInObject,
ReferenceStoredInEnum,
ReferenceEscapeIntoClosure,
UseAfterMove,
ExclusiveRefAcrossTaskBoundary,
SharedRefAcrossDetachedTask,
InconsistentReferenceReturn,
CallSiteAliasConflict,
NonSendableAcrossTaskBoundary,
}Variants§
Cannot borrow as mutable while shared borrow is active.
ConflictExclusiveExclusive
Cannot borrow as mutable while another mutable borrow is active.
ReadWhileExclusivelyBorrowed
Cannot read while exclusively borrowed.
WriteWhileBorrowed
Cannot write while any borrow is active.
ReferenceEscape
Reference escapes its scope.
ReferenceStoredInArray
Reference stored into an array.
ReferenceStoredInObject
Reference stored into an object or struct literal.
ReferenceStoredInEnum
Reference stored into an enum payload.
ReferenceEscapeIntoClosure
Reference escapes into a closure environment.
UseAfterMove
Use after move.
ExclusiveRefAcrossTaskBoundary
Cannot share exclusive reference across task boundary.
Cannot share any reference across detached task boundary.
InconsistentReferenceReturn
Reference returns must produce a reference on every path from the same borrowed origin and borrow kind.
CallSiteAliasConflict
Two arguments at a call site alias the same variable but the callee requires them to be non-aliased (one is mutated, the other is read).
NonSendableAcrossTaskBoundary
Non-sendable value (e.g., closure with mutable captures) sent across a detached task boundary.
Implementations§
Source§impl BorrowErrorKind
impl BorrowErrorKind
Sourcepub fn code(&self) -> BorrowErrorCode
pub fn code(&self) -> BorrowErrorCode
Map this error kind to the stable user-facing error code.
Trait Implementations§
Source§impl Clone for BorrowErrorKind
impl Clone for BorrowErrorKind
Source§fn clone(&self) -> BorrowErrorKind
fn clone(&self) -> BorrowErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BorrowErrorKind
impl Debug for BorrowErrorKind
Source§impl PartialEq for BorrowErrorKind
impl PartialEq for BorrowErrorKind
impl Eq for BorrowErrorKind
impl StructuralPartialEq for BorrowErrorKind
Auto Trait Implementations§
impl Freeze for BorrowErrorKind
impl RefUnwindSafe for BorrowErrorKind
impl Send for BorrowErrorKind
impl Sync for BorrowErrorKind
impl Unpin for BorrowErrorKind
impl UnsafeUnpin for BorrowErrorKind
impl UnwindSafe for BorrowErrorKind
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
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<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
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more