pub struct CapabilityRequirement {
pub kind: CapabilityKind,
pub level: RequirementLevel,
pub desired: SupportState,
}Expand description
One requirement in a CapabilityRequest.
desired is the support level the client is requesting. The
negotiation comparison uses SupportState equality plus the
implicit ordering “any non-Unavailable state is at least as
supportive as Unavailable” — adapters whose claim equals or
strengthens the desired state satisfy the requirement; adapters
whose claim is Unavailable (or the optional capability is
missing entirely) do not.
Fields§
§kind: CapabilityKind§level: RequirementLevel§desired: SupportStateMinimum acceptable support. Native is the strongest.
Synthesized, Partial, Manual, and Unavailable are
progressively weaker. A client typically asks for
Synthesized or Native; asking for Manual is unusual
but valid.
Implementations§
Source§impl CapabilityRequirement
impl CapabilityRequirement
pub fn required(kind: CapabilityKind, desired: SupportState) -> Self
pub fn preferred(kind: CapabilityKind, desired: SupportState) -> Self
pub fn optional(kind: CapabilityKind, desired: SupportState) -> Self
Trait Implementations§
Source§impl Clone for CapabilityRequirement
impl Clone for CapabilityRequirement
Source§fn clone(&self) -> CapabilityRequirement
fn clone(&self) -> CapabilityRequirement
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 CapabilityRequirement
impl Debug for CapabilityRequirement
Source§impl PartialEq for CapabilityRequirement
impl PartialEq for CapabilityRequirement
Source§fn eq(&self, other: &CapabilityRequirement) -> bool
fn eq(&self, other: &CapabilityRequirement) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CapabilityRequirement
impl StructuralPartialEq for CapabilityRequirement
Auto Trait Implementations§
impl Freeze for CapabilityRequirement
impl RefUnwindSafe for CapabilityRequirement
impl Send for CapabilityRequirement
impl Sync for CapabilityRequirement
impl Unpin for CapabilityRequirement
impl UnsafeUnpin for CapabilityRequirement
impl UnwindSafe for CapabilityRequirement
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
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.