#[non_exhaustive]pub struct Capabilities {
pub compiled: Vec<BackendKind>,
pub available: Vec<BackendKind>,
}Expand description
Compile-time + runtime snapshot of hardware backend capabilities.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.compiled: Vec<BackendKind>Backends that were compiled in (selected via Cargo features).
available: Vec<BackendKind>Backends that compiled in AND are usable at runtime (e.g. a
cuda feature compiled but no CUDA driver → not in this list).
Same as compiled for now; populated by
crate::device::detect in a later phase.
Implementations§
Source§impl Capabilities
impl Capabilities
Sourcepub fn new(compiled: Vec<BackendKind>) -> Self
pub fn new(compiled: Vec<BackendKind>) -> Self
Build a snapshot from the list of compiled-in backends.
available is initialised as a clone of compiled; real
runtime filtering lands once voxora-backend gains a
candle feature in 0.2.x.
Sourcepub fn is_compiled(&self, kind: BackendKind) -> bool
pub fn is_compiled(&self, kind: BackendKind) -> bool
True iff kind is compiled in.
Sourcepub fn is_available(&self, kind: BackendKind) -> bool
pub fn is_available(&self, kind: BackendKind) -> bool
True iff kind is compiled in AND usable at runtime.
Sourcepub fn iter_compiled(&self) -> Iter<'_, BackendKind> ⓘ
pub fn iter_compiled(&self) -> Iter<'_, BackendKind> ⓘ
Iterate over backends that were compiled in.
Sourcepub fn iter_available(&self) -> Iter<'_, BackendKind> ⓘ
pub fn iter_available(&self) -> Iter<'_, BackendKind> ⓘ
Iterate over backends that compiled in AND are usable at runtime.
Trait Implementations§
Source§impl Clone for Capabilities
impl Clone for Capabilities
Source§fn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Capabilities
impl Debug for Capabilities
impl Eq for Capabilities
Source§impl PartialEq for Capabilities
impl PartialEq for Capabilities
impl StructuralPartialEq for Capabilities
Auto Trait Implementations§
impl Freeze for Capabilities
impl RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnsafeUnpin for Capabilities
impl UnwindSafe for Capabilities
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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