pub enum TryLockError {
Error(Error),
WouldBlock,
}
Expand description
An enumeration of possible errors which can occur while trying to acquire a lock
from the try_lock
method and try_lock_shared
method on a File
.
Variants§
Error(Error)
The lock could not be acquired due to an I/O error on the file. The standard library will
not return an ErrorKind::WouldBlock
error inside TryLockError::Error
WouldBlock
The lock could not be acquired at this time because it is held by another handle/process.
Trait Implementations§
1.89.0 · Source§impl Debug for TryLockError
impl Debug for TryLockError
1.89.0 · Source§impl Display for TryLockError
impl Display for TryLockError
1.89.0 · Source§impl Error for TryLockError
impl Error for TryLockError
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
Source§#[doc(hidden)] fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
#[doc(hidden)] fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
🔬This is a nightly-only experimental API. (
error_type_id
#60784)Gets the
TypeId
of self
.1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.89.0 · Source§impl From<TryLockError> for Error
impl From<TryLockError> for Error
Source§fn from(err: TryLockError) -> Error
fn from(err: TryLockError) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TryLockError
impl !RefUnwindSafe for TryLockError
impl Send for TryLockError
impl Sync for TryLockError
impl Unpin for TryLockError
impl !UnwindSafe for TryLockError
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
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more