[][src]Struct structural::field::ownership::RunDrop

pub struct RunDrop<'a, T> { /* fields omitted */ }

A guard that drops the value that a mutable reference points when it is dropped.

Implementations

impl<'a, T> RunDrop<'a, T>[src]

pub unsafe fn new(mutref: &'a mut T) -> Self[src]

Constructs this RunDrop.

Safety

In the destructor for this type, this drops the value that the mutable reference points to.

Once the destructor for this type runs,the pointed-to value must not be used again, that includes the destructor for the value running.

Drop order

Remember that variables on the stack are dropped in the opposite order than they are declared.

In this example:

This example is not tested
let a=Foo;
let b=Bar;
let c=Baz;

c gets dropped first,then b, then a.

pub unsafe fn get_mut(&mut self) -> &mut T[src]

Reborrows the wrapped mutable reference.

Safety

The returned references must not be mutated, only passed to accessor trait (declared in structural) methods for moving out fields .

Trait Implementations

impl<'a, T> Drop for RunDrop<'a, T>[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for RunDrop<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for RunDrop<'a, T> where
    T: Send

impl<'a, T> Sync for RunDrop<'a, T> where
    T: Sync

impl<'a, T> Unpin for RunDrop<'a, T>

impl<'a, T> !UnwindSafe for RunDrop<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<This, T> Array0<T> for This where
    This: ?Sized
[src]

impl<This, V, T> Array0Variant<T, V> for This where
    This: ?Sized
[src]

impl<This, T> ArrayMove0<T> for This where
    This: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<This, T> IntoStructural<T> for This where
    T: FromStructural<This>, 
[src]

impl<T> SelfOps for T where
    T: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The error type returned when the conversion fails.

impl<This, T> TryIntoStructural<T> for This where
    T: TryFromStructural<This>, 
[src]

type Error = <T as TryFromStructural<This>>::Error

The error parameter of TryFromError, returned from try_into_structural on conversion error. Read more

impl<T> TypeIdentity for T where
    T: ?Sized
[src]

type Type = T

The same type as Self. Read more