Skip to main content

RuntimeMemory

Struct RuntimeMemory 

Source
pub struct RuntimeMemory<M: Memory> { /* private fields */ }
Expand description

RuntimeMemory

Exclusive non-cloneable allocation lease. IO trusts custody between checked boundaries; growth commits the directory before publishing its new extent. A detached lease retains the backing claim until it is dropped.

Implementations§

Source§

impl<M: Memory> RuntimeMemory<M>

Source

pub fn size(&self) -> u64

Logical page extent.

Source

pub fn grow(&self, pages: u64) -> Result<u64, RuntimeGrowError>

Reserve additional zero-filled logical pages without exposing backing.

Source

pub fn read(&self, offset: u64, bytes: &mut [u8])

Read a completely bounds-checked logical range.

Source

pub fn write(&self, offset: u64, bytes: &[u8])

Write a completely bounds-checked logical range.

Trait Implementations§

Source§

impl<M: Memory> Memory for RuntimeMemory<M>

Source§

fn size(&self) -> u64

Current extent in 65,536-byte pages.
Source§

fn grow(&self, pages: u64) -> i64

Add zero-filled pages, or return -1 on refusal.
Source§

fn read(&self, offset: u64, bytes: &mut [u8])

Read an admitted byte range.
Source§

fn write(&self, offset: u64, bytes: &[u8])

Write an admitted byte range. Native writes need not be transactional.

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for RuntimeMemory<M>

§

impl<M> !Send for RuntimeMemory<M>

§

impl<M> !Sync for RuntimeMemory<M>

§

impl<M> !UnwindSafe for RuntimeMemory<M>

§

impl<M> Freeze for RuntimeMemory<M>
where Lease<M>: Freeze,

§

impl<M> Unpin for RuntimeMemory<M>
where Lease<M>: Unpin,

§

impl<M> UnsafeUnpin for RuntimeMemory<M>
where Lease<M>: UnsafeUnpin,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.