pub struct CallRequest {
pub tool: String,
pub args: Value,
pub resource: String,
}Expand description
The action a leash decision is about: a tool name, its arguments, and the resolved resource the policy keys on.
Resolve before constructing. A resource (and any path-bearing args)
must already be canonicalized (realpath, normalized refspec) so the human
approves the resolved effect, not a ..-bearing alias.
Fields§
§tool: StringThe dispatch name of the tool (e.g. git.push, email.send).
args: ValueThe tool arguments (the MCP arguments object).
resource: StringThe resolved, policy-relevant resource (e.g. github.com/org/repo,
a realpath, a recipient set).
Implementations§
Source§impl CallRequest
impl CallRequest
Sourcepub fn new(
tool: impl Into<String>,
args: Value,
resource: impl Into<String>,
) -> CallRequest
pub fn new( tool: impl Into<String>, args: Value, resource: impl Into<String>, ) -> CallRequest
Construct a request.
Sourcepub fn unspecified(tool: impl Into<String>) -> CallRequest
pub fn unspecified(tool: impl Into<String>) -> CallRequest
A request with no arguments and no resource — used by the back-compat no-step-up path.
Sourcepub fn content_id(&self) -> ContentId
pub fn content_id(&self) -> ContentId
The content address of this action, computed over a canonical
serialization of (tool, canonical(args), resource).
Canonicalization sorts object keys recursively (so argument order cannot
change the identity) and is robust to whether serde_json’s
preserve_order feature is enabled. Full RFC 8785 number/string
normalization is a follow-up; for now the byte form is deterministic and
order-independent, which is what the binding requires.
Trait Implementations§
Source§impl Clone for CallRequest
impl Clone for CallRequest
Source§fn clone(&self) -> CallRequest
fn clone(&self) -> CallRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CallRequest
impl RefUnwindSafe for CallRequest
impl Send for CallRequest
impl Sync for CallRequest
impl Unpin for CallRequest
impl UnsafeUnpin for CallRequest
impl UnwindSafe for CallRequest
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,
Source§impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Self to a value of type T.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> ⓘ
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