pub struct MockBackendStreams {
pub pending: Option<u32>,
pub capacity: u32,
}Expand description
A test-only fuel_backend_contract::backend::BackendStreams handle
reporting a fixed (pending_work_count, slot_capacity) — the simulated
live-load signal C2’s tests inject in place of a real device. Lives
here (not behind #[cfg(test)]) so the route-picker + bridge tests can
build a fake load lookup without re-deriving the trait wiring.
Fields§
§pending: Option<u32>What pending_work_count() reports. None = “I can’t measure” (a
streaming backend with no depth available) ⇒ tier 0.
capacity: u32What slot_capacity() reports.
Implementations§
Trait Implementations§
Source§impl BackendRuntime for MockBackendStreams
impl BackendRuntime for MockBackendStreams
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 MockBackendStreams
impl BackendStreams for MockBackendStreams
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 MockBackendStreams
impl RefUnwindSafe for MockBackendStreams
impl Send for MockBackendStreams
impl Sync for MockBackendStreams
impl Unpin for MockBackendStreams
impl UnsafeUnpin for MockBackendStreams
impl UnwindSafe for MockBackendStreams
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