PatchStagingBuffer

Struct PatchStagingBuffer 

Source
pub struct PatchStagingBuffer<const DC: usize, const EC: usize> { /* private fields */ }
Expand description

Fixed-capacity staging buffer for transactional writes.

DC is the data capacity in bytes, EC is the max number of entries.

Implementations§

Source§

impl<const DC: usize, const EC: usize> PatchStagingBuffer<DC, EC>

Source

pub const fn new() -> Self

Trait Implementations§

Source§

impl<const DC: usize, const EC: usize> Default for PatchStagingBuffer<DC, EC>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const DC: usize, const EC: usize> StagingBuffer for PatchStagingBuffer<DC, EC>

Source§

fn any_staged(&self) -> bool

Returns true if any writes are staged.
Source§

fn for_each_staged<F>(&self, f: F) -> Result<(), ShadowError>
where F: FnMut(u16, &[u8]) -> Result<(), ShadowError>,

Iterates over all staged writes in order.
Source§

fn write_staged(&mut self, addr: u16, data: &[u8]) -> Result<(), ShadowError>

Stages a write to be applied on commit.
Source§

fn apply_overlay(&self, addr: u16, out: &mut [u8]) -> Result<(), ShadowError>

Applies staged writes to the output buffer for the given address range.
Source§

fn clear_staged(&mut self) -> Result<(), ShadowError>

Clears all staged writes.

Auto Trait Implementations§

§

impl<const DC: usize, const EC: usize> Freeze for PatchStagingBuffer<DC, EC>

§

impl<const DC: usize, const EC: usize> RefUnwindSafe for PatchStagingBuffer<DC, EC>

§

impl<const DC: usize, const EC: usize> Send for PatchStagingBuffer<DC, EC>

§

impl<const DC: usize, const EC: usize> Sync for PatchStagingBuffer<DC, EC>

§

impl<const DC: usize, const EC: usize> Unpin for PatchStagingBuffer<DC, EC>

§

impl<const DC: usize, const EC: usize> UnwindSafe for PatchStagingBuffer<DC, EC>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.