Trait miri::interpret::Projectable
source · pub trait Projectable<'tcx, Prov>: Sized + Debugwhere
Prov: Provenance,{
// Required methods
fn layout(&self) -> TyAndLayout<'tcx, Ty<'tcx>>;
fn meta(&self) -> MemPlaceMeta<Prov>;
fn offset_with_meta<'mir, M>(
&self,
offset: Size,
meta: MemPlaceMeta<Prov>,
layout: TyAndLayout<'tcx, Ty<'tcx>>,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<Self, InterpErrorInfo<'tcx>>
where M: Machine<'mir, 'tcx, Provenance = Prov>;
fn to_op<'mir, M>(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<OpTy<'tcx, <M as Machine<'mir, 'tcx>>::Provenance>, InterpErrorInfo<'tcx>>
where M: Machine<'mir, 'tcx, Provenance = Prov>;
// Provided methods
fn len<'mir, M>(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<u64, InterpErrorInfo<'tcx>>
where M: Machine<'mir, 'tcx, Provenance = Prov> { ... }
fn offset<'mir, M>(
&self,
offset: Size,
layout: TyAndLayout<'tcx, Ty<'tcx>>,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<Self, InterpErrorInfo<'tcx>>
where M: Machine<'mir, 'tcx, Provenance = Prov> { ... }
fn transmute<'mir, M>(
&self,
layout: TyAndLayout<'tcx, Ty<'tcx>>,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<Self, InterpErrorInfo<'tcx>>
where M: Machine<'mir, 'tcx, Provenance = Prov> { ... }
}
Expand description
A thing that we can project into, and that has a layout.
Required Methods§
sourcefn layout(&self) -> TyAndLayout<'tcx, Ty<'tcx>>
fn layout(&self) -> TyAndLayout<'tcx, Ty<'tcx>>
Get the layout.
sourcefn meta(&self) -> MemPlaceMeta<Prov>
fn meta(&self) -> MemPlaceMeta<Prov>
Get the metadata of a wide value.
sourcefn offset_with_meta<'mir, M>(
&self,
offset: Size,
meta: MemPlaceMeta<Prov>,
layout: TyAndLayout<'tcx, Ty<'tcx>>,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<Self, InterpErrorInfo<'tcx>>where
M: Machine<'mir, 'tcx, Provenance = Prov>,
fn offset_with_meta<'mir, M>( &self, offset: Size, meta: MemPlaceMeta<Prov>, layout: TyAndLayout<'tcx, Ty<'tcx>>, ecx: &InterpCx<'mir, 'tcx, M> ) -> Result<Self, InterpErrorInfo<'tcx>>where M: Machine<'mir, 'tcx, Provenance = Prov>,
Offset the value by the given amount, replacing the layout and metadata.
sourcefn to_op<'mir, M>(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<OpTy<'tcx, <M as Machine<'mir, 'tcx>>::Provenance>, InterpErrorInfo<'tcx>>where
M: Machine<'mir, 'tcx, Provenance = Prov>,
fn to_op<'mir, M>( &self, ecx: &InterpCx<'mir, 'tcx, M> ) -> Result<OpTy<'tcx, <M as Machine<'mir, 'tcx>>::Provenance>, InterpErrorInfo<'tcx>>where M: Machine<'mir, 'tcx, Provenance = Prov>,
Convert this to an OpTy
. This might be an irreversible transformation, but is useful for
reading from this thing.
Provided Methods§
sourcefn len<'mir, M>(
&self,
ecx: &InterpCx<'mir, 'tcx, M>
) -> Result<u64, InterpErrorInfo<'tcx>>where
M: Machine<'mir, 'tcx, Provenance = Prov>,
fn len<'mir, M>( &self, ecx: &InterpCx<'mir, 'tcx, M> ) -> Result<u64, InterpErrorInfo<'tcx>>where M: Machine<'mir, 'tcx, Provenance = Prov>,
Get the length of a slice/string/array stored here.