pub enum LinearError {
UseAfterMove {
resource: String,
state: Ownership,
},
MultipleUse {
resource: String,
count: usize,
},
UnusedResource {
resource: String,
kind: LinearKind,
},
BorrowedAtEndOfScope {
resource: String,
},
UnknownResource {
resource: String,
},
DuplicateResource {
resource: String,
},
}Expand description
Error types for linear type violations.
Variants§
UseAfterMove
Attempted to use a resource after it was moved
MultipleUse
Attempted to use a linear resource multiple times
UnusedResource
A linear/relevant resource was never used
BorrowedAtEndOfScope
Resource was still borrowed at end of scope
UnknownResource
Unknown resource
DuplicateResource
Resource already exists
Trait Implementations§
Source§impl Clone for LinearError
impl Clone for LinearError
Source§fn clone(&self) -> LinearError
fn clone(&self) -> LinearError
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 LinearError
impl Debug for LinearError
Source§impl Display for LinearError
impl Display for LinearError
Source§impl Error for LinearError
impl Error for LinearError
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()
Auto Trait Implementations§
impl Freeze for LinearError
impl RefUnwindSafe for LinearError
impl Send for LinearError
impl Sync for LinearError
impl Unpin for LinearError
impl UnwindSafe for LinearError
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