#[non_exhaustive]pub struct Capabilities {
pub identity: BackendIdentity,
pub supports: Supports,
}Expand description
Full capability snapshot for a backend: its BackendIdentity
plus a flat Supports surface of per-method bools.
Consumers typically read caps.supports.<field> to gate a UI
surface or choose between two code paths before dispatching; the
Self::identity side exists for metrics dimensioning + UI
labelling.
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.identity: BackendIdentityBackend identity tuple this snapshot was assembled for.
supports: SupportsPer-capability support bools.
Implementations§
Source§impl Capabilities
impl Capabilities
Sourcepub const fn new(identity: BackendIdentity, supports: Supports) -> Self
pub const fn new(identity: BackendIdentity, supports: Supports) -> Self
Construct a Capabilities value from an identity + a populated
Supports. Backends typically build one in capabilities()
without going through a constructor; this exists for
out-of-tree backends that prefer the explicit call.
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 · 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
Source§impl PartialEq for Capabilities
impl PartialEq for Capabilities
impl Copy for Capabilities
impl Eq 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