pub enum LocalReason {
Alias(&'static str),
ProcessLifecycle,
WritesRepository,
SessionLocal,
RendersCapability(&'static str),
}Expand description
Why a command belongs to the command line alone.
The variants are the four structural reasons this executable has, and there is no fifth for “not projected yet”: a read that belongs in the API and is missing from it is a defect, and a vocabulary that can express it politely is a vocabulary that will.
Variants§
Alias(&'static str)
The command runs a default subcommand when none is given: it is that command’s
other name, not an operation of its own. The target is the full command, as a
person types it after majordomus.
ProcessLifecycle
What the command produces is a running process, not a value. There is nothing for a request/response projection to return, and the caller of such a projection would be asking the server to become a different server.
WritesRepository
The command writes into the repository. Every projection of the registry is read-only — that is the executable’s first promise — so a command that writes is offered to the person who runs the executable and to nobody over a network.
SessionLocal
The command answers about the working copy and the shell that invoked it. A caller over HTTP or MCP does not share either, so the same question asked over a socket would be a different question with the same name, which is worse than not asking it.
RendersCapability(&'static str)
The command renders, for a person at a terminal, the value the named capability answers. The operation is in the API; this is its terminal rendering. The domain logic is shared — the command and the capability read the same resolution — and only the shaping of the output is the command’s own.
Implementations§
Source§impl LocalReason
impl LocalReason
Sourcepub fn renders(self) -> Option<&'static str>
pub fn renders(self) -> Option<&'static str>
The capability this command renders, when it renders one.
use majordomus_cli::cli::local::LocalReason;
assert_eq!(LocalReason::RendersCapability("web.surfaces").renders(), Some("web.surfaces"));
assert_eq!(LocalReason::ProcessLifecycle.renders(), None);Trait Implementations§
Source§impl Clone for LocalReason
impl Clone for LocalReason
Source§fn clone(&self) -> LocalReason
fn clone(&self) -> LocalReason
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 LocalReason
Source§impl Debug for LocalReason
impl Debug for LocalReason
impl Eq for LocalReason
Source§impl PartialEq for LocalReason
impl PartialEq for LocalReason
Source§fn eq(&self, other: &LocalReason) -> bool
fn eq(&self, other: &LocalReason) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LocalReason
Auto Trait Implementations§
impl Freeze for LocalReason
impl RefUnwindSafe for LocalReason
impl Send for LocalReason
impl Sync for LocalReason
impl Unpin for LocalReason
impl UnsafeUnpin for LocalReason
impl UnwindSafe for LocalReason
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> 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.