pub trait MemorySlice: Send + Debug + PartialEq + Eq + Clone + Hash {
    type Edge: Edge;
    type EdgeIterator: Iterator<Item = Self::Edge>;

    // Required methods
    fn iter_edges(&self) -> Self::EdgeIterator;
    fn object(&self) -> Option<ObjectReference>;
    fn start(&self) -> Address;
    fn bytes(&self) -> usize;
    fn copy(src: &Self, tgt: &Self);
}
Expand description

A abstract memory slice represents a piece of heap memory.

Required Associated Types§

source

type Edge: Edge

The associate type to define how to access edges from a memory slice.

source

type EdgeIterator: Iterator<Item = Self::Edge>

The associate type to define how to iterate edges in a memory slice.

Required Methods§

source

fn iter_edges(&self) -> Self::EdgeIterator

Iterate object edges within the slice. If there are non-reference values in the slice, the iterator should skip them.

source

fn object(&self) -> Option<ObjectReference>

The object which this slice belongs to. If we know the object for the slice, we will check the object state (e.g. mature or not), rather than the slice address. Normally checking the object and checking the slice does not make a difference, as the slice is part of the object (in terms of memory range). However, if a slice is in a different location from the object, the object state and the slice can be hugely different, and providing a proper implementation of this method for the owner object is important.

source

fn start(&self) -> Address

Start address of the memory slice

source

fn bytes(&self) -> usize

Size of the memory slice

source

fn copy(src: &Self, tgt: &Self)

Memory copy support

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MemorySlice for Range<Address>

Implementors§