[−][src]Struct structural::field::ownership::IntoFieldsWrapper
Helper type for moving fields out of a Structural type.
Drop behavior
The wrapped value is put inside a ManuallyDrop
so that its destructor doesn't run.
When this is dropped,instead of running the destructor for the wrapped value,
this calls DropFields::drop_fields
on it,
to drop the fields that haven't been moved out.
Example
For an example that uses IntoFieldsWrapper
there's the
implementation example for RevIntoMultiFieldImpl
Implementations
impl<T: DropFields> IntoFieldsWrapper<T>
[src]
pub fn new(value: T) -> Self
[src]
Constructs this IntoFieldsWrapper
,wrapping the value
.
Also calls DropFields::pre_move
on the wrapped value
pub unsafe fn inner_and_moved_mut(&mut self) -> (&mut T, &mut MovedOutFields)
[src]
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.
pub unsafe fn inner_and_moved_raw(&mut self) -> (*mut T, *mut MovedOutFields)
[src]
Gets mutable pointers to the wrapped value,
and the MovedOutFields
that tracks which fields were moved out of it.
Safety
The returned pointers 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<T: DropFields> Drop for IntoFieldsWrapper<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for IntoFieldsWrapper<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for IntoFieldsWrapper<T> where
T: Send,
T: Send,
impl<T> Sync for IntoFieldsWrapper<T> where
T: Sync,
T: Sync,
impl<T> Unpin for IntoFieldsWrapper<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for IntoFieldsWrapper<T> where
T: UnwindSafe,
T: UnwindSafe,
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;