[−][src]Struct potential::Lease
The leased item. Item will be sent back to the owner on drop()
unless stolen with steal()
.
Lease does not allow empty state so as long as it exists, it must have the item.
As long as Lease
exists, Potential
will be waiting for return (unless reset). Drop Lease
or steal it to release the wait.
Implementations
impl<T> Lease<T>
[src]
pub fn close(self) -> Option<T>
[src]
Return the lease to owner, destroying the lease. If the owner doesn't listen anymore, the item is returned to caller.
pub fn replace(&mut self, replacement: T) -> T
[src]
Replace the item within the lease
pub fn steal(self) -> T
[src]
Steal the leased item destroying the lease.
Potential
await calls will return None
.
Trait Implementations
impl<T: Debug> Debug for Lease<T>
[src]
impl<T> Deref for Lease<T>
[src]
impl<T> DerefMut for Lease<T>
[src]
impl<T> Drop for Lease<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Lease<T>
impl<T> Send for Lease<T> where
T: Send,
T: Send,
impl<T> Sync for Lease<T> where
T: Send + Sync,
T: Send + Sync,
impl<T> Unpin for Lease<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Lease<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,