Skip to main content

RuntimeResourceDriver

Struct RuntimeResourceDriver 

Source
pub struct RuntimeResourceDriver<R>
where R: DeviceRuntime,
{ /* private fields */ }
Expand description

Production transaction adapter for a concrete DeviceRuntime.

Core owns reservation ordering, allocation authority, buffers, and capacity claims. This adapter therefore has no parallel allocator ledger: reserve, rollback, and release are acknowledgements, while commit consumes the exact core-issued allocation permit.

Implementations§

Source§

impl<R> RuntimeResourceDriver<R>
where R: DeviceRuntime,

Source

pub fn new(runtime: Arc<R>) -> Result<Self, VNextError>

Source

pub fn runtime(&self) -> &Arc<R>

Source

pub fn retained_pool_count(&self) -> usize

Number of pools retained after an indeterminate transaction outcome. Normal provisioning and shutdown leave this at zero.

Trait Implementations§

Source§

impl<R> ResourceTransactionDriver for RuntimeResourceDriver<R>
where R: DeviceRuntime,

Source§

type Buffer = <R as DeviceRuntime>::Buffer

Source§

type Runtime = R

Source§

fn runtime(&self) -> &Arc<Self::Runtime>

Source§

fn device_id(&self) -> &DeviceId

Source§

fn device_runtime_implementation_fingerprint(&self) -> &str

Source§

fn device_capacity_bytes(&self) -> u64

Source§

fn reserve_resource( &mut self, _context: &ResourceTransactionContext<'_, Self::Runtime>, _reservation: &ResourceReservation, ) -> Result<(), ResourceDriverFailure>

Source§

fn commit_resource<'commit>( &mut self, context: &'commit ResourceTransactionContext<'_, Self::Runtime>, reservation: &ResourceReservation, ) -> Result<DeviceAllocationReceipt<'commit>, ResourceDriverFailure>

Source§

fn compensate_reserve_resource( &mut self, _context: &ResourceTransactionContext<'_, Self::Runtime>, _reservation: &ResourceReservation, ) -> Result<(), ResourceDriverFailure>

Source§

fn compensate_commit_resource( &mut self, _context: &ResourceTransactionContext<'_, Self::Runtime>, _reservation: &ResourceReservation, _buffer: &Self::Buffer, ) -> Result<(), ResourceDriverFailure>

Source§

fn rollback_resource( &mut self, _context: &ResourceTransactionContext<'_, Self::Runtime>, _reservation: &ResourceReservation, ) -> Result<(), ResourceDriverFailure>

Source§

fn release_resource( &mut self, _context: &ResourceTransactionContext<'_, Self::Runtime>, _reservation: &ResourceReservation, _buffer: &Self::Buffer, ) -> Result<(), ResourceDriverFailure>

Source§

fn reconcile_commit_outcome( &mut self, _context: &ResourceTransactionContext<'_, Self::Runtime>, _expected: &ResourceReservation, _actual: ResourceCommitView<'_, Self::Buffer>, ) -> Result<(), ResourceDriverFailure>

Source§

fn quarantine_transaction( &mut self, _context: &ResourceTransactionContext<'_, Self::Runtime>, ownership: ResourcePoolOwnership<Self::Runtime>, ) -> Result<(), ResourceOwnershipTransferFailure<Self::Runtime>>

Source§

fn abandon_transaction( &mut self, ownership: ResourcePoolOwnership<Self::Runtime>, )

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> 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> Same for T

Source§

type Output = T

Should always be Self
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, <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