CustomRegion

Trait CustomRegion 

Source
pub trait CustomRegion<B> {
    // Required methods
    fn read(
        &self,
        read_kind: Val<B>,
        address: Address,
        bytes: u32,
        solver: &mut Solver<'_, B>,
        tag: bool,
    ) -> Result<Val<B>, ExecError>;
    fn write(
        &mut self,
        write_kind: Val<B>,
        address: Address,
        data: Val<B>,
        solver: &mut Solver<'_, B>,
        tag: Option<Val<B>>,
    ) -> Result<Val<B>, ExecError>;
    fn initial_value(&self, address: Address, bytes: u32) -> Option<B>;
    fn memory_kind(&self) -> &'static str;
    fn clone_dyn(&self) -> Box<dyn Send + Sync + CustomRegion<B>>;
}

Required Methods§

Source

fn read( &self, read_kind: Val<B>, address: Address, bytes: u32, solver: &mut Solver<'_, B>, tag: bool, ) -> Result<Val<B>, ExecError>

Source

fn write( &mut self, write_kind: Val<B>, address: Address, data: Val<B>, solver: &mut Solver<'_, B>, tag: Option<Val<B>>, ) -> Result<Val<B>, ExecError>

Source

fn initial_value(&self, address: Address, bytes: u32) -> Option<B>

Source

fn memory_kind(&self) -> &'static str

Return a static string denoting the ‘kind’ of memory this custom region is representing, e.g. “device” or “page_table”. This information is only used for display purposes, and has not semantic meaning.

Source

fn clone_dyn(&self) -> Box<dyn Send + Sync + CustomRegion<B>>

Trait objects (dyn T) are in general not cloneable, so we require a method that allows us to implement clone ourselves for types containing Box<dyn T>. The implementation will nearly always be just Box::new(self.clone()).

Implementors§