Struct BasicMemory
pub struct BasicMemory<T, ProvExtra = (), AllocExtra = ()>where
T: Target + Obj,
ProvExtra: Obj,
AllocExtra: Obj,{
allocations: List<Allocation<ProvExtra, AllocExtra>>,
_phantom: PhantomData<T>,
}Fields§
§allocations: List<Allocation<ProvExtra, AllocExtra>>§_phantom: PhantomData<T>Trait Implementations§
§impl<T, ProvExtra, AllocExtra> Clone for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> Clone for BasicMemory<T, ProvExtra, AllocExtra>
§fn clone(&self) -> BasicMemory<T, ProvExtra, AllocExtra>
fn clone(&self) -> BasicMemory<T, ProvExtra, AllocExtra>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T, ProvExtra, AllocExtra> Copy for BasicMemory<T, ProvExtra, AllocExtra>
§impl<T, ProvExtra, AllocExtra> Debug for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> Debug for BasicMemory<T, ProvExtra, AllocExtra>
§impl<'de, T, ProvExtra, AllocExtra> Deserialize<'de> for BasicMemory<T, ProvExtra, AllocExtra>
impl<'de, T, ProvExtra, AllocExtra> Deserialize<'de> for BasicMemory<T, ProvExtra, AllocExtra>
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BasicMemory<T, ProvExtra, AllocExtra>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BasicMemory<T, ProvExtra, AllocExtra>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T, ProvExtra, AllocExtra> Eq for BasicMemory<T, ProvExtra, AllocExtra>
§impl<T, ProvExtra, AllocExtra> Hash for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> Hash for BasicMemory<T, ProvExtra, AllocExtra>
§impl<T> Memory for BasicMemory<T>
impl<T> Memory for BasicMemory<T>
§type FrameExtra = ()
type FrameExtra = ()
The basic memory model does not need any per-frame data,
so we set FrameExtra to the unit type.
§type Provenance = (AllocId, ())
type Provenance = (AllocId, ())
The type of pointer provenance.
§fn new(_params: ()) -> BasicMemory<T>
fn new(_params: ()) -> BasicMemory<T>
Create a new instance of the memory model with the given parameters.
§fn allocate(
&mut self,
kind: AllocationKind,
size: Size,
align: Align,
) -> NdResult<ThinPointer<<BasicMemory<T> as Memory>::Provenance>, TerminationInfo>
fn allocate( &mut self, kind: AllocationKind, size: Size, align: Align, ) -> NdResult<ThinPointer<<BasicMemory<T> as Memory>::Provenance>, TerminationInfo>
Create a new allocation.
The initial contents of the allocation are
AbstractByte::Uninit. Read more§fn deallocate(
&mut self,
ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>,
kind: AllocationKind,
size: Size,
align: Align,
) -> Result<(), TerminationInfo>
fn deallocate( &mut self, ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>, kind: AllocationKind, size: Size, align: Align, ) -> Result<(), TerminationInfo>
Remove an allocation.
§fn store(
&mut self,
ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>,
bytes: List<AbstractByte<<BasicMemory<T> as Memory>::Provenance>>,
align: Align,
) -> Result<(), TerminationInfo>
fn store( &mut self, ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>, bytes: List<AbstractByte<<BasicMemory<T> as Memory>::Provenance>>, align: Align, ) -> Result<(), TerminationInfo>
Write some bytes to memory.
§fn load(
&mut self,
ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>,
len: Size,
align: Align,
) -> Result<List<AbstractByte<<BasicMemory<T> as Memory>::Provenance>>, TerminationInfo>
fn load( &mut self, ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>, len: Size, align: Align, ) -> Result<List<AbstractByte<<BasicMemory<T> as Memory>::Provenance>>, TerminationInfo>
Read some bytes from memory. Read more
§fn dereferenceable(
&self,
ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>,
len: Size,
) -> Result<(), TerminationInfo>
fn dereferenceable( &self, ptr: ThinPointer<<BasicMemory<T> as Memory>::Provenance>, len: Size, ) -> Result<(), TerminationInfo>
Test whether the given pointer is dereferenceable for the given size.
§fn new_call() -> <BasicMemory<T> as Memory>::FrameExtra
fn new_call() -> <BasicMemory<T> as Memory>::FrameExtra
Create the extra information for a stack frame.
§fn leak_check(&self) -> Result<(), TerminationInfo>
fn leak_check(&self) -> Result<(), TerminationInfo>
Check if there are any memory leaks.
§fn signed_dereferenceable(
&self,
ptr: ThinPointer<Self::Provenance>,
len: Int,
) -> Result<(), TerminationInfo>
fn signed_dereferenceable( &self, ptr: ThinPointer<Self::Provenance>, len: Int, ) -> Result<(), TerminationInfo>
A derived form of
dereferenceable that works with a signed notion of “length”.§fn retag_ptr(
&mut self,
_frame_extra: &mut Self::FrameExtra,
ptr: Pointer<Self::Provenance>,
_ptr_type: PtrType,
_fn_entry: bool,
_fn_implicit_writes: bool,
_vtable_lookup: impl Fn(ThinPointer<Self::Provenance>) -> VTable + 'static,
) -> Result<Pointer<Self::Provenance>, TerminationInfo>
fn retag_ptr( &mut self, _frame_extra: &mut Self::FrameExtra, ptr: Pointer<Self::Provenance>, _ptr_type: PtrType, _fn_entry: bool, _fn_implicit_writes: bool, _vtable_lookup: impl Fn(ThinPointer<Self::Provenance>) -> VTable + 'static, ) -> Result<Pointer<Self::Provenance>, TerminationInfo>
Retag the given pointer, which has the given type.
fn_entry indicates whether this is one of the special retags that happen
right at the top of each function. Read more§fn end_call(&mut self, _extra: Self::FrameExtra) -> Result<(), TerminationInfo>
fn end_call(&mut self, _extra: Self::FrameExtra) -> Result<(), TerminationInfo>
Memory model hook invoked at the end of each function call.
§impl<T, ProvExtra, AllocExtra> Ord for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> Ord for BasicMemory<T, ProvExtra, AllocExtra>
§fn cmp(&self, other: &BasicMemory<T, ProvExtra, AllocExtra>) -> Ordering
fn cmp(&self, other: &BasicMemory<T, ProvExtra, AllocExtra>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
§impl<T, ProvExtra, AllocExtra> PartialEq for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> PartialEq for BasicMemory<T, ProvExtra, AllocExtra>
§impl<T, ProvExtra, AllocExtra> PartialOrd for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> PartialOrd for BasicMemory<T, ProvExtra, AllocExtra>
§impl<T, ProvExtra, AllocExtra> Serialize for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> Serialize for BasicMemory<T, ProvExtra, AllocExtra>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T, ProvExtra, AllocExtra> StructuralPartialEq for BasicMemory<T, ProvExtra, AllocExtra>
Auto Trait Implementations§
impl<T, ProvExtra = (), AllocExtra = ()> !Send for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra = (), AllocExtra = ()> !Sync for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> Freeze for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> RefUnwindSafe for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> Unpin for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> UnsafeUnpin for BasicMemory<T, ProvExtra, AllocExtra>
impl<T, ProvExtra, AllocExtra> UnwindSafe for BasicMemory<T, ProvExtra, AllocExtra>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more