pub trait Value<'mir, 'tcx, M>: Copy where
M: Machine<'mir, 'tcx>, {
fn layout(&self) -> TyAndLayout<'tcx, Ty<'tcx>>;
fn to_op(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<OpTy<'tcx, <M as Machine<'mir, 'tcx>>::PointerTag>, InterpErrorInfo<'tcx>>;
fn from_mem_place(
mplace: MPlaceTy<'tcx, <M as Machine<'mir, 'tcx>>::PointerTag>
) -> Self;
fn project_downcast(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
variant: VariantIdx
) -> Result<Self, InterpErrorInfo<'tcx>>;
fn project_field(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
field: usize
) -> Result<Self, InterpErrorInfo<'tcx>>;
}Required Methods
fn layout(&self) -> TyAndLayout<'tcx, Ty<'tcx>>
fn layout(&self) -> TyAndLayout<'tcx, Ty<'tcx>>
Gets this value’s layout.
fn to_op(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<OpTy<'tcx, <M as Machine<'mir, 'tcx>>::PointerTag>, InterpErrorInfo<'tcx>>
fn to_op(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<OpTy<'tcx, <M as Machine<'mir, 'tcx>>::PointerTag>, InterpErrorInfo<'tcx>>
Makes this into an OpTy.
fn from_mem_place(
mplace: MPlaceTy<'tcx, <M as Machine<'mir, 'tcx>>::PointerTag>
) -> Self
fn from_mem_place(
mplace: MPlaceTy<'tcx, <M as Machine<'mir, 'tcx>>::PointerTag>
) -> Self
Creates this from an MPlaceTy.
fn project_downcast(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
variant: VariantIdx
) -> Result<Self, InterpErrorInfo<'tcx>>
fn project_downcast(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
variant: VariantIdx
) -> Result<Self, InterpErrorInfo<'tcx>>
Projects to the given enum variant.
fn project_field(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
field: usize
) -> Result<Self, InterpErrorInfo<'tcx>>
fn project_field(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
field: usize
) -> Result<Self, InterpErrorInfo<'tcx>>
Projects to the n-th field.