pub struct MockCombinedRuntime {
pub available: Option<u64>,
pub total: Option<u64>,
pub pending: Option<u32>,
pub capacity: u32,
}Expand description
A test-only runtime handle carrying BOTH a VRAM signal
(available/total, read by the VRAM guard) AND a live-load signal
(pending/capacity, read through BackendStreams) — the exact shape of
the production DeviceRuntimeHandle, which answers both would_fit and
pending_work_count off one handle. Used by the C2 headline-gate test
to build a 2-device branched graph whose arms are both VRAM-fit but
differ in live load.
Fields§
§available: Option<u64>VRAM available bytes (the guard’s available_bytes).
total: Option<u64>VRAM total bytes (the guard’s total_bytes).
pending: Option<u32>Live in-flight count (pending_work_count).
capacity: u32Advertised slot capacity (slot_capacity).
Trait Implementations§
Source§impl BackendRuntime for MockCombinedRuntime
impl BackendRuntime for MockCombinedRuntime
Source§fn available_bytes(&self) -> Option<u64>
fn available_bytes(&self) -> Option<u64>
Bytes currently available for new allocations on this
backend’s device.
None when the backend genuinely cannot
measure (no OS query exposed, no vendor API supports it). Read moreSource§fn total_bytes(&self) -> Option<u64>
fn total_bytes(&self) -> Option<u64>
Total memory on this backend’s device. Static after first
call; implementations cache unconditionally.
None for
backends with unbounded notional capacity (e.g. Reference
returns Some(u64::MAX), or None if the backend prefers
to advertise “unknowable”).Source§fn as_backend_streams(&self) -> Option<&dyn BackendStreams>
fn as_backend_streams(&self) -> Option<&dyn BackendStreams>
Tier-2 upcast seam: a runtime handle that also exposes a
deferred-execution queue model returns
Some(self) so a
selector holding only a &dyn BackendRuntime (the type the
route picker’s BackendRuntimeLookup hands out) can reach
the BackendStreams live-load surface without naming the
concrete handle type. Read moreSource§impl BackendStreams for MockCombinedRuntime
impl BackendStreams for MockCombinedRuntime
Source§fn pending_work_count(&self) -> Option<u32>
fn pending_work_count(&self) -> Option<u32>
Number of slots (streams / queues / command buffers) currently
busy with submitted-but-not-yet-finished work, for this handle’s
device.
None when the backend dispatches synchronously and has
no queue concept (selectors then have no load signal — fall back
to static cost, never treat None as “idle”).Source§fn slot_capacity(&self) -> u32
fn slot_capacity(&self) -> u32
Maximum concurrent in-flight work this backend advertises. Used
by the runtime route picker for load tiering (
count / slot_capacity) and dispatch lookahead sizing.Auto Trait Implementations§
impl Freeze for MockCombinedRuntime
impl RefUnwindSafe for MockCombinedRuntime
impl Send for MockCombinedRuntime
impl Sync for MockCombinedRuntime
impl Unpin for MockCombinedRuntime
impl UnsafeUnpin for MockCombinedRuntime
impl UnwindSafe for MockCombinedRuntime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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