pub struct Caveats {
pub fs_read: Scope<String>,
pub fs_write: Scope<String>,
pub exec: Scope<String>,
pub net: Scope<String>,
pub max_calls: CountBound,
pub valid_for_generation: Scope<u64>,
}Expand description
The capability set an agent holds — one element of the authority meet-semilattice. See the module docs.
Fields§
§fs_read: Scope<String>Filesystem paths the agent may read.
fs_write: Scope<String>Filesystem paths the agent may write.
exec: Scope<String>Commands the agent may execute.
net: Scope<String>Network hosts the agent may reach.
max_calls: CountBoundUpper bound on tool calls this authority permits.
valid_for_generation: Scope<u64>Generation counters this authority is valid for (causal, not wall-clock — a caveat keys on “flight N”, never on time).
Implementations§
Source§impl Caveats
impl Caveats
Sourcepub fn top() -> Caveats
pub fn top() -> Caveats
⊤ — unrestricted authority on every axis. Equivalent to “no caveats”,
i.e. the user’s full authority.
Trait Implementations§
Source§impl CaveatsExt for Caveats
impl CaveatsExt for Caveats
Source§fn permits_fs_read(&self, path: &str) -> bool
fn permits_fs_read(&self, path: &str) -> bool
Does this authority permit reading
path? Read moreSource§fn permits_fs_write(&self, path: &str) -> bool
fn permits_fs_write(&self, path: &str) -> bool
Does this authority permit writing
path?Source§fn permits_exec(&self, cmd: &str) -> bool
fn permits_exec(&self, cmd: &str) -> bool
Does this authority permit executing
cmd?Source§fn permits_net(&self, host: &str) -> bool
fn permits_net(&self, host: &str) -> bool
Does this authority permit a network call to
host?Source§impl<'de> Deserialize<'de> for Caveats
impl<'de> Deserialize<'de> for Caveats
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Caveats, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Caveats, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Caveats
Source§impl Serialize for Caveats
impl Serialize for Caveats
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Caveats
Auto Trait Implementations§
impl Freeze for Caveats
impl RefUnwindSafe for Caveats
impl Send for Caveats
impl Sync for Caveats
impl Unpin for Caveats
impl UnsafeUnpin for Caveats
impl UnwindSafe for Caveats
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
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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