pub struct ReleaseGuard<T> { /* private fields */ }Expand description
A wrapper a round a Releasable object that will check, in test and when assertion are enabled, that the value has been released before being dropped.
Implementations§
Source§impl<T> ReleaseGuard<T>
impl<T> ReleaseGuard<T>
Sourcepub fn take(this: ReleaseGuard<T>) -> T
pub fn take(this: ReleaseGuard<T>) -> T
Disarm this release guard.
This will prevent any runtime check that the value has been correctly released.
Trait Implementations§
Source§impl<T> AsRef<T> for ReleaseGuard<T>
impl<T> AsRef<T> for ReleaseGuard<T>
Source§impl<T> Borrow<T> for ReleaseGuard<T>
impl<T> Borrow<T> for ReleaseGuard<T>
Source§impl<T: Clone> Clone for ReleaseGuard<T>
impl<T: Clone> Clone for ReleaseGuard<T>
Source§impl<T: Debug> Debug for ReleaseGuard<T>
impl<T: Debug> Debug for ReleaseGuard<T>
Source§impl<T: Default> Default for ReleaseGuard<T>
impl<T: Default> Default for ReleaseGuard<T>
Source§impl<T> Deref for ReleaseGuard<T>
impl<T> Deref for ReleaseGuard<T>
Source§impl<T> DerefMut for ReleaseGuard<T>
impl<T> DerefMut for ReleaseGuard<T>
impl<T: Eq> Eq for ReleaseGuard<T>
Source§impl<T> From<T> for ReleaseGuard<T>
impl<T> From<T> for ReleaseGuard<T>
Source§impl<T: Hash> Hash for ReleaseGuard<T>
impl<T: Hash> Hash for ReleaseGuard<T>
Source§impl<T: Ord> Ord for ReleaseGuard<T>
impl<T: Ord> Ord for ReleaseGuard<T>
Source§fn cmp(&self, other: &ReleaseGuard<T>) -> Ordering
fn cmp(&self, other: &ReleaseGuard<T>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T: PartialEq> PartialEq for ReleaseGuard<T>
impl<T: PartialEq> PartialEq for ReleaseGuard<T>
Source§impl<T: PartialOrd> PartialOrd for ReleaseGuard<T>
impl<T: PartialOrd> PartialOrd for ReleaseGuard<T>
Source§impl<T: Releasable> Releasable for ReleaseGuard<T>
impl<T: Releasable> Releasable for ReleaseGuard<T>
Auto Trait Implementations§
impl<T> !Freeze for ReleaseGuard<T>
impl<T> RefUnwindSafe for ReleaseGuard<T>where
T: RefUnwindSafe,
impl<T> Send for ReleaseGuard<T>where
T: Send,
impl<T> Sync for ReleaseGuard<T>where
T: Sync,
impl<T> Unpin for ReleaseGuard<T>where
T: Unpin,
impl<T> UnsafeUnpin for ReleaseGuard<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ReleaseGuard<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R> CryptoRng for R
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<R> Rng for R
impl<R> Rng for R
impl<R> RngCore for Rwhere
R: Rng,
§impl<R> RngExt for Rwhere
R: Rng + ?Sized,
impl<R> RngExt for Rwhere
R: Rng + ?Sized,
§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read more§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘwhere
Self: Sized,
StandardUniform: Distribution<T>,
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘwhere
Self: Sized,
StandardUniform: Distribution<T>,
§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read more§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read more§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
impl<R> TryCryptoRng for R
§impl<R> TryRng for R
impl<R> TryRng for R
§type Error = <<R as Deref>::Target as TryRng>::Error
type Error = <<R as Deref>::Target as TryRng>::Error
The type returned in the event of a RNG error. Read more
§fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
Return the next random
u32.§fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
Return the next random
u64.§fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
Fill
dst entirely with random data.