pub enum GpuTestGate {
Ready(&'static GpuRuntime),
AbsentDevice,
}Expand description
The outcome of asking for a device in a test.
Variants§
Ready(&'static GpuRuntime)
A runtime resolved; the test body must proceed and assert.
AbsentDevice
No device on this host, under a policy that permits running without
one. Counted by skipped_for_absent_device and announced on stderr.
Implementations§
Source§impl GpuTestGate
impl GpuTestGate
Sourcepub fn runtime(&self) -> Option<&'static GpuRuntime>
pub fn runtime(&self) -> Option<&'static GpuRuntime>
The runtime, or None when the host has no device.
Deliberately NOT Option-shaped at the call site by default: a caller
that writes let Some(rt) = gate.runtime() else { return } is back to
the idiom this module exists to remove. Prefer matching on the gate so
the absent arm is written out and visible in review.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuTestGate
impl RefUnwindSafe for GpuTestGate
impl Send for GpuTestGate
impl Sync for GpuTestGate
impl Unpin for GpuTestGate
impl UnsafeUnpin for GpuTestGate
impl UnwindSafe for GpuTestGate
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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