Trait rustc_const_eval::interpret::visitor::Value [−][src]
pub trait Value<'mir, 'tcx, M: Machine<'mir, 'tcx>>: Copy {
fn layout(&self) -> TyAndLayout<'tcx>;
fn to_op(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>;
fn from_mem_place(mplace: MPlaceTy<'tcx, M::PointerTag>) -> Self;
fn project_downcast(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
variant: VariantIdx
) -> InterpResult<'tcx, Self>;
fn project_field(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
field: usize
) -> InterpResult<'tcx, Self>;
}
Required methods
fn layout(&self) -> TyAndLayout<'tcx>
fn layout(&self) -> TyAndLayout<'tcx>
Gets this value’s layout.
fn to_op(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
fn to_op(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>>
Makes this into an OpTy
.
fn from_mem_place(mplace: MPlaceTy<'tcx, M::PointerTag>) -> Self
fn from_mem_place(mplace: MPlaceTy<'tcx, M::PointerTag>) -> Self
Creates this from an MPlaceTy
.
fn project_downcast(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
variant: VariantIdx
) -> InterpResult<'tcx, Self>
fn project_downcast(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
variant: VariantIdx
) -> InterpResult<'tcx, Self>
Projects to the given enum variant.
fn project_field(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
field: usize
) -> InterpResult<'tcx, Self>
fn project_field(
&self,
ecx: &InterpCx<'mir, 'tcx, M>,
field: usize
) -> InterpResult<'tcx, Self>
Projects to the n-th field.