1use crate::fmt;
9
10#[unstable(feature = "sync_nonpoison", issue = "134645")]
12pub type TryLockResult<Guard> = Result<Guard, WouldBlock>;
13
14#[unstable(feature = "sync_nonpoison", issue = "134645")]
16pub struct WouldBlock;
17
18#[unstable(feature = "sync_nonpoison", issue = "134645")]
19impl fmt::Debug for WouldBlock {
20 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21 "WouldBlock".fmt(f)
22 }
23}
24
25#[unstable(feature = "sync_nonpoison", issue = "134645")]
26impl fmt::Display for WouldBlock {
27 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
28 "try_lock failed because the operation would block".fmt(f)
29 }
30}
31
32#[unstable(feature = "mapped_lock_guards", issue = "117108")]
33pub use self::mutex::MappedMutexGuard;
34#[unstable(feature = "nonpoison_mutex", issue = "134645")]
35pub use self::mutex::{Mutex, MutexGuard};
36
37mod mutex;