ConsecBlocks

Struct ConsecBlocks 

Source
pub struct ConsecBlocks {
    pub blocks: Vec<Memory>,
}
Expand description

Collection of consecutive physical memory blocks.

This struct manages multiple Memory blocks that may or may not be physically contiguous. It provides a unified interface for accessing memory across multiple allocations while tracking physical address ranges.

Fields§

§blocks: Vec<Memory>

Vector of memory blocks managed by this collection

Implementations§

Source§

impl ConsecBlocks

Source

pub fn new(blocks: Vec<Memory>) -> Self

Creates a new collection of consecutive memory blocks.

§Arguments
  • blocks - Vector of memory blocks to manage
Source

pub fn dealloc(self)

Deallocates all memory blocks in this collection.

Consumes self and frees all underlying memory allocations.

Trait Implementations§

Source§

impl BytePointer for ConsecBlocks

Source§

fn addr(&self, offset: usize) -> *mut u8

Returns a mutable pointer to the byte at the given offset. Read more
Source§

fn ptr(&self) -> *mut u8

Returns a mutable pointer to the start of the memory region.
Source§

fn len(&self) -> usize

Returns the total length of the memory region in bytes.
Source§

fn dump(&self, file: &str) -> Result<()>

Dumps memory contents to a file in hexadecimal format. Read more
Source§

impl Clone for ConsecBlocks

Source§

fn clone(&self) -> ConsecBlocks

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConsecBlocks

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl GetConsecPfns for ConsecBlocks

Source§

fn consec_pfns(&self) -> Result<Vec<Range<PhysAddr>>, Error>

Returns the consecutive PFN ranges for this memory region. Read more
Source§

fn log_pfns(&self, level: Level)

Logs the PFN ranges at the specified log level.
Source§

impl VictimMemory for ConsecBlocks

Auto Trait Implementations§

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> Checkable for T
where T: VictimMemory,

Source§

fn check(&self, pattern: DataPattern) -> Vec<BitFlip>

Checks memory against a pattern and returns detected bit flips.
Source§

fn check_excluding( &self, pattern: DataPattern, pages: &[*const u8], ) -> Vec<BitFlip>

Checks memory excluding specific pages.
Source§

fn check_cb( &self, f: &mut dyn FnMut(usize) -> Option<[u8; 4096]>, ) -> Vec<BitFlip>

Checks memory using a callback function to generate expected values.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Initializable for T
where T: VictimMemory,

Source§

fn initialize(&self, pattern: DataPattern)

Initializes memory with the given data pattern.
Source§

fn initialize_excluding(&self, pattern: DataPattern, pages: &[*const u8])

Initializes memory excluding specific pages.
Source§

fn initialize_cb(&self, f: &mut dyn FnMut(usize) -> Option<[u8; 4096]>)

Initializes memory using a callback function. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PfnResolver for T
where T: BytePointer,

Source§

fn pfn(&self) -> Result<PhysAddr, LinuxPageMapError>

Returns the physical frame number for this address. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V