pub struct OperationCapability {
pub name: String,
pub summary: String,
pub availability: &'static str,
pub requires: Vec<&'static str>,
}Expand description
One operation’s capability.
Fields§
§name: String§summary: String§availability: &'static strOne word, not two booleans.
The first draft carried supported and applicable, which is four bools
on one struct and — more to the point — a shape a client has to know the
meaning of. They are not redundant only in the archive case, and that is the
case that matters: an operation can be understood and still not be
performable, and collapsing the two into one word would either have to call
archive “supported” (a lie a client acts on) or “unavailable” (which loses the
fact that the request was at least well-formed). So one enum with three
states, and a client reads a word rather than a pair of flags.
requires: Vec<&'static str>What the request must also carry, besides a selection: target, kind, or
nothing. A list rather than two bools, so adding a requirement is a new entry
rather than a new field every client has to learn about.
Trait Implementations§
Source§impl Clone for OperationCapability
impl Clone for OperationCapability
Source§impl Debug for OperationCapability
impl Debug for OperationCapability
impl Eq for OperationCapability
Source§impl PartialEq for OperationCapability
impl PartialEq for OperationCapability
Source§impl Serialize for OperationCapability
impl Serialize for OperationCapability
impl StructuralPartialEq for OperationCapability
Auto Trait Implementations§
impl Freeze for OperationCapability
impl RefUnwindSafe for OperationCapability
impl Send for OperationCapability
impl Sync for OperationCapability
impl Unpin for OperationCapability
impl UnsafeUnpin for OperationCapability
impl UnwindSafe for OperationCapability
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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