Enum rustc_mir_transform::shim::Adjustment
source · enum Adjustment {
Identity,
Deref,
RefMut,
}
Variants
Identity
Pass the receiver as-is.
Deref
We get passed &[mut] self
and call the target with *self
.
This either copies self
(if Self: Copy
, eg. for function items), or moves out of it
(for VTableShim
, which effectively is passed &own Self
).
RefMut
We get passed self: Self
and call the target with &mut self
.
In this case we need to ensure that the Self
is dropped after the call, as the callee
won’t do it for us.
Trait Implementations
sourceimpl Clone for Adjustment
impl Clone for Adjustment
sourcefn clone(&self) -> Adjustment
fn clone(&self) -> Adjustment
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Adjustment
impl Debug for Adjustment
sourceimpl PartialEq<Adjustment> for Adjustment
impl PartialEq<Adjustment> for Adjustment
sourcefn eq(&self, other: &Adjustment) -> bool
fn eq(&self, other: &Adjustment) -> bool
impl Copy for Adjustment
impl StructuralPartialEq for Adjustment
Auto Trait Implementations
impl RefUnwindSafe for Adjustment
impl Send for Adjustment
impl Sync for Adjustment
impl Unpin for Adjustment
impl UnwindSafe for Adjustment
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Identity
: 0 bytesDeref
: 0 bytesRefMut
: 0 bytes