pub enum Effect {
ReadOnly,
LocalMutation,
RepositoryMutation,
NetworkMutation,
Destructive,
}Expand description
What running a command changes. The one thing a surface policy is allowed to ask.
The order is the order of increasing consequence, and it is the order the derived exposure policy reads: a surface declares the strongest effect it will carry, and every node at or below it is projected there. Nothing configures a surface per command.
Variants§
ReadOnly
Reads and answers. Changes nothing anywhere.
LocalMutation
Writes only where the repository keeps a checkout’s own state — the process’s
memory, .ai/local/, a build directory. Nothing a commit would carry.
RepositoryMutation
Writes tracked files: generated artifacts, the worktree, git itself.
NetworkMutation
Reaches the network with an effect on the far side: a push, a deploy, a release.
Destructive
Removes something a person would have to reconstruct.
Implementations§
Source§impl Effect
impl Effect
Sourcepub fn of_capability(policy: ExecutionPolicy) -> Self
pub fn of_capability(policy: ExecutionPolicy) -> Self
The effect of a capability, from the execution policy the registry classified.
Read from the policy rather than from the kind alone, because the kind cannot tell the two commands apart: announcing a peer changes this process’s memory, and moving an issue writes a tracked file a commit will carry. This function is what the exposure policy consults — a surface carries every node at or below the strongest effect it declares — so a capability whose effect was understated here would be projected onto a surface whose ceiling exists to exclude it.
Sourcepub fn is_read_only(self) -> bool
pub fn is_read_only(self) -> bool
Does this effect leave the repository as it found it?
Trait Implementations§
impl Copy for Effect
Source§impl<'de> Deserialize<'de> for Effect
impl<'de> Deserialize<'de> for Effect
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 Effect
Source§impl JsonSchema for Effect
impl JsonSchema for Effect
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 Effect
impl Ord for Effect
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Effect
impl PartialOrd for Effect
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnsafeUnpin for Effect
impl UnwindSafe for Effect
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.