pub enum CapabilityKind {
Query,
Command,
Resource,
}Expand description
What a capability is. Three kinds exist because three semantics exist: something that
is executed and changes nothing, something that is executed and changes this process’s
own memory, and something that is read. A command may also write the repository’s own
tracked records, which its kind does not say and its execution policy does
(ExecutionPolicy::writes_repository).
How long a call takes is not a kind. A read that walks every file of the layer is
still a read, and the thing that makes it worth watching — that it reports as it goes
and stops when it is asked to — is one property of its handler, declared with
crate::capability::Executable::cancellable and carried on ExecutionPolicy.
Variants§
Query
Executable and read-only: a typed handler, an input schema, an output schema.
Command
Executable and changing something: a typed handler, bound to POST over HTTP, and
announced to MCP clients as not read-only. Most reach no further than this process’s
own memory (a peer announcing itself); one that writes the repository’s tracked
records says so on its execution policy, which is where a projection reads it.
Resource
Declarative content the repository holds: read as it is, never executed.
Implementations§
Source§impl CapabilityKind
impl CapabilityKind
Sourcepub fn is_executable(self) -> bool
pub fn is_executable(self) -> bool
Is a capability of this kind called, with a handler, rather than read?
use majordomus_cli::capability::CapabilityKind;
assert!(CapabilityKind::Query.is_executable() && CapabilityKind::Command.is_executable());
assert!(!CapabilityKind::Resource.is_executable());Sourcepub fn is_read_only(self) -> bool
pub fn is_read_only(self) -> bool
Does a call of this kind leave the process as it found it?
use majordomus_cli::capability::CapabilityKind;
assert!(CapabilityKind::Query.is_read_only());
assert!(!CapabilityKind::Command.is_read_only());Trait Implementations§
Source§impl Clone for CapabilityKind
impl Clone for CapabilityKind
Source§fn clone(&self) -> CapabilityKind
fn clone(&self) -> CapabilityKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CapabilityKind
Source§impl Debug for CapabilityKind
impl Debug for CapabilityKind
Source§impl<'de> Deserialize<'de> for CapabilityKind
impl<'de> Deserialize<'de> for CapabilityKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CapabilityKind
Source§impl JsonSchema for CapabilityKind
impl JsonSchema for CapabilityKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for CapabilityKind
impl Ord for CapabilityKind
Source§fn cmp(&self, other: &CapabilityKind) -> Ordering
fn cmp(&self, other: &CapabilityKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CapabilityKind
impl PartialEq for CapabilityKind
Source§fn eq(&self, other: &CapabilityKind) -> bool
fn eq(&self, other: &CapabilityKind) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CapabilityKind
impl PartialOrd for CapabilityKind
Source§impl Serialize for CapabilityKind
impl Serialize for CapabilityKind
impl StructuralPartialEq for CapabilityKind
Auto Trait Implementations§
impl Freeze for CapabilityKind
impl RefUnwindSafe for CapabilityKind
impl Send for CapabilityKind
impl Sync for CapabilityKind
impl Unpin for CapabilityKind
impl UnsafeUnpin for CapabilityKind
impl UnwindSafe for CapabilityKind
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
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.