Skip to main content

ExecutableOperation

Struct ExecutableOperation 

Source
pub struct ExecutableOperation { /* private fields */ }
Expand description

A handler plus the operation descriptor shared by HTTP and MCP.

Implementations§

Source§

impl ExecutableOperation

Source

pub fn typed<F>(descriptor: OperationDescriptor, handler: F) -> Self
where F: for<'input> Fn(InvocationInput<'input>) -> Result<OperationFuture, InputRejection> + 'static,

Source

pub fn json<I, O, F, Fut>(descriptor: OperationDescriptor, handler: F) -> Self
where I: ApiModel + DeserializeOwned + 'static, O: OperationOutput + 'static, F: Fn(Json<I>) -> Fut + 'static, Fut: Future<Output = O> + 'static,

Source

pub fn empty<O, F, Fut>(descriptor: OperationDescriptor, handler: F) -> Self
where O: OperationOutput + 'static, F: Fn() -> Fut + 'static, Fut: Future<Output = O> + 'static,

Source

pub const fn descriptor(&self) -> &OperationDescriptor

Source

pub async fn invoke(&self, input: Value) -> ExecutionOutcome

Source

pub async fn invoke_controlled( &self, input: Value, control: InvocationControl, ) -> ExecutionOutcome

Source

pub async fn invoke_http( &self, request: &dyn HttpRequestParts, ) -> ExecutionOutcome

Source

pub async fn invoke_http_controlled( &self, request: &dyn HttpRequestParts, control: InvocationControl, ) -> ExecutionOutcome

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> BackgroundExt for T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ResponseExt for T

Source§

fn header( self, name: impl Into<String>, value: impl Into<String>, ) -> WithHeaders<Self>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.