[−][src]Struct structural::field::ownership::RunDropFields
A guard that calls DropFields::drop_fields
on the mutable reference
when it is dropped.
Implementations
impl<'a, T> RunDropFields<'a, T> where
T: DropFields,
[src]
T: DropFields,
pub unsafe fn new(mutref: &'a mut T, moved: MovedOutFields) -> Self
[src]
Constructs this RunDropFields.
Safety
This has the same safety requirements as DropFields::drop_fields
.
Drop order
Remember that variables on the stack are dropped in the opposite order than they are declared.
In this example:
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 .
impl<'a, T> RunDropFields<'a, T> where
T: DropFields,
[src]
T: DropFields,
pub unsafe fn get_mut_and_moved_fields(
&mut self
) -> (&mut T, &mut MovedOutFields)
[src]
&mut self
) -> (&mut T, &mut MovedOutFields)
Gets mutable references to the wrapped value,
and the MovedOutFields
that tracks which fields were moved out of it
Safety
The returned references must not be mutated, only passed to accessor trait (declared in structural) methods for moving out fields .
Mutating MovedOutFields
incorrectly can lead to leaks and double dropped fields.
Trait Implementations
impl<'a, T> Drop for RunDropFields<'a, T> where
T: DropFields,
[src]
T: DropFields,
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for RunDropFields<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for RunDropFields<'a, T> where
T: Send,
T: Send,
impl<'a, T> Sync for RunDropFields<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for RunDropFields<'a, T>
impl<'a, T> !UnwindSafe for RunDropFields<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<This, T> Array0<T> for This where
This: ?Sized,
[src]
This: ?Sized,
impl<This, V, T> Array0Variant<T, V> for This where
This: ?Sized,
[src]
This: ?Sized,
impl<This, T> ArrayMove0<T> for This where
This: ?Sized,
[src]
This: ?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<This, T> IntoStructural<T> for This where
T: FromStructural<This>,
[src]
T: FromStructural<This>,
fn into_structural(Self) -> T
[src]
impl<T> SelfOps for T where
T: ?Sized,
[src]
T: ?Sized,
const T: PhantomData<fn() -> Self>
[src]
const T_D: PhantomData<Self>
[src]
fn assert_ty(self, _other: PhantomData<fn() -> Self>) -> Self
[src]
fn assert_ty_ref(&self, _other: PhantomData<fn() -> Self>) -> &Self
[src]
fn assert_ty_mut(&mut self, _other: PhantomData<fn() -> Self>) -> &mut Self
[src]
fn ty_(&self) -> PhantomData<fn() -> Self>
[src]
fn ty_d(&self) -> PhantomData<Self>
[src]
fn ty_inv(&self) -> PhantomData<fn(Self) -> Self>
[src]
fn ty_inv_ref(&self) -> PhantomData<Cell<&Self>>
[src]
fn eq_id(&self, other: &Self) -> bool
[src]
fn piped<F, U>(self, f: F) -> U where
F: FnOnce(Self) -> U,
[src]
F: FnOnce(Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> U where
F: FnOnce(&'a Self) -> U,
[src]
F: FnOnce(&'a Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> U where
F: FnOnce(&'a mut Self) -> U,
[src]
F: FnOnce(&'a mut Self) -> U,
fn mutated<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
fn observe<F>(self, f: F) -> Self where
F: FnOnce(&Self),
[src]
F: FnOnce(&Self),
fn into_<T>(self, PhantomData<fn() -> T>) -> T where
Self: Into<T>,
[src]
Self: Into<T>,
fn as_ref_<T>(&self) -> &T where
Self: AsRef<T>,
T: ?Sized,
[src]
Self: AsRef<T>,
T: ?Sized,
fn as_mut_<T>(&mut self) -> &mut T where
Self: AsMut<T>,
T: ?Sized,
[src]
Self: AsMut<T>,
T: ?Sized,
fn drop_(self)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The error type returned when the conversion fails.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<This, T> TryIntoStructural<T> for This where
T: TryFromStructural<This>,
[src]
T: TryFromStructural<This>,
type Error = <T as TryFromStructural<This>>::Error
The error parameter of TryFromError
, returned from try_into_structural
on conversion error. Read more
fn try_into_structural(
Self
) -> Result<T, TryFromError<This, <This as TryIntoStructural<T>>::Error>>
[src]
Self
) -> Result<T, TryFromError<This, <This as TryIntoStructural<T>>::Error>>
impl<T> TypeIdentity for T where
T: ?Sized,
[src]
T: ?Sized,
type Type = T
The same type as Self. Read more
fn into_type_val(self) -> Self::Type where
Self::Type: Sized,
[src]
Self::Type: Sized,
fn into_type_ref(&self) -> &Self::Type
[src]
fn into_type_mut(&mut self) -> &mut Self::Type
[src]
fn into_type_box(self: Box<Self>) -> Box<Self::Type>ⓘImportant traits for Box<R>
impl<R> Read for Box<R> where
R: Read + ?Sized, impl<W> Write for Box<W> where
W: Write + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Important traits for Box<R>
impl<R> Read for Box<R> where
R: Read + ?Sized, impl<W> Write for Box<W> where
W: Write + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
[src]
fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
[src]
fn from_type_val(this: Self::Type) -> Self where
Self::Type: Sized,
[src]
Self::Type: Sized,
fn from_type_ref(this: &Self::Type) -> &Self
[src]
fn from_type_mut(this: &mut Self::Type) -> &mut Self
[src]
fn from_type_box(this: Box<Self::Type>) -> Box<Self>ⓘImportant traits for Box<R>
impl<R> Read for Box<R> where
R: Read + ?Sized, impl<W> Write for Box<W> where
W: Write + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Important traits for Box<R>
impl<R> Read for Box<R> where
R: Read + ?Sized, impl<W> Write for Box<W> where
W: Write + ?Sized, impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;