SimpleLockError

Enum SimpleLockError 

Source
pub enum SimpleLockError {
    AlreadyLocked,
    InvalidName,
    UnableToUnlock(String),
    PermissionDenied,
    NoLockEnabled,
    UnknownError(String),
}
Expand description

SimpleLock’s Error type.

Variants§

§

AlreadyLocked

The Lock was already taken by another process, we cannot lock.

This will only be returned if the LockConfig provided explicitly disables hang_lock. In other-words, if we want to fail immediately on the inability to lock.

§

InvalidName

The name given on Lock creation (either with default_lock or an implementation’s constructor) is invalid.

This can be due to OS path name restrictions or being invalid unicode, etc.

§

UnableToUnlock(String)

We failed to unlock the Lock.

This can be due to a number of issues. Using FileLock as an example, if the temporary file disappears due to an unreliable OS File-Cleaner, its permissions change out-from-under-us, etc.

§

PermissionDenied

The File Descriptor was created with permissions you do not currently have.

This may happen if the program was executed as a super-user and failed to clean up open files. If not using the provided utility functionality, please revisit them to see if any fit your needs. They may handle an edge-case your application hits.

§

NoLockEnabled

Thrown when calling default_lock and no feature flag was enabled.

§

UnknownError(String)

An unexpected error from one of the Lock implementations. If this happens, please file a ticket with us as we would like to harden this library over time.

Trait Implementations§

Source§

impl Debug for SimpleLockError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SimpleLockError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SimpleLockError

1.30.0 · Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Errno> for SimpleLockError

Source§

fn from(e: Errno) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SimpleLockError

Source§

fn from(other: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SimpleLockError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ErrorKind> for SimpleLockError

Source§

fn from(other: ErrorKind) -> Self

Converts to this type from the input type.
Source§

impl Ord for SimpleLockError

Source§

fn cmp(&self, other: &SimpleLockError) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for SimpleLockError

Source§

fn eq(&self, other: &SimpleLockError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for SimpleLockError

Source§

fn partial_cmp(&self, other: &SimpleLockError) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for SimpleLockError

Source§

impl StructuralPartialEq for SimpleLockError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V