pub struct MemoryValidator;Expand description
Memory validation utilities
Implementations§
Source§impl MemoryValidator
impl MemoryValidator
Sourcepub unsafe fn validate_range<T>(ptr: *const T, count: usize) -> UtilsResult<()>
pub unsafe fn validate_range<T>(ptr: *const T, count: usize) -> UtilsResult<()>
Validate that a memory range is accessible
§Safety
This function performs raw pointer arithmetic and validation. The caller
must ensure that the provided pointer was obtained through safe means and
that the memory range [ptr, ptr + count * size_of::<T>()] is within valid
allocated memory boundaries. Incorrect usage can lead to undefined behavior.
Sourcepub fn validate_alignment<T>(
ptr: *const T,
required_alignment: usize,
) -> UtilsResult<()>
pub fn validate_alignment<T>( ptr: *const T, required_alignment: usize, ) -> UtilsResult<()>
Validate memory alignment
Sourcepub fn validate_buffer_access(
buffer_size: usize,
offset: usize,
access_size: usize,
) -> UtilsResult<()>
pub fn validate_buffer_access( buffer_size: usize, offset: usize, access_size: usize, ) -> UtilsResult<()>
Validate buffer bounds
Auto Trait Implementations§
impl Freeze for MemoryValidator
impl RefUnwindSafe for MemoryValidator
impl Send for MemoryValidator
impl Sync for MemoryValidator
impl Unpin for MemoryValidator
impl UnwindSafe for MemoryValidator
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> 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