Skip to main content

Operation

Struct Operation 

Source
pub struct Operation<Handler, Inputs = (), Args = (), Transform = ()> { /* private fields */ }
Expand description

Carries a typed operation declaration as first-order data.

Implementations§

Source§

impl<Handler, Inputs, Args, Transform> Operation<Handler, Inputs, Args, Transform>
where Inputs: WithAlg, Args: WithAlg,

Source

pub fn with<Input>( self, ) -> WithInput<Handler, Inputs, Args, Transform, Direct<Input>, Input>

Records an argument supplied directly in the interpreter’s input product.

Source

pub fn path<Input>( self, ) -> WithInput<Handler, Inputs, Args, Transform, Path<Input>, Input>

Records a path extractor whose value becomes the next handler argument.

Source

pub fn query<Input>( self, ) -> WithInput<Handler, Inputs, Args, Transform, Query<Input>, Input>

Records a query extractor whose value becomes the next handler argument.

Source

pub fn body<Input>( self, ) -> WithInput<Handler, Inputs, Args, Transform, Body<Input>, Input>

Records a request-body extractor whose value becomes the next handler argument.

Source

pub fn header<Input>( self, ) -> WithInput<Handler, Inputs, Args, Transform, Header<Input>, Input>

Records a header extractor whose value becomes the next handler argument.

Source

pub fn auth<Input>( self, ) -> WithInput<Handler, Inputs, Args, Transform, Auth<Input>, Input>

Records an authentication extractor whose value becomes the next handler argument.

Source

pub fn context<Input>( self, ) -> WithInput<Handler, Inputs, Args, Transform, Context<Input>, Input>

Records an endpoint-context extractor whose value becomes the next handler argument.

Source

pub fn out<NewTransform>(self) -> Operation<Handler, Inputs, Args, NewTransform>

Replaces the declaration’s output-kind marker without converting a value.

The selected kind is interpreted only after the handler result type is known at the compilation boundary.

Source

pub fn json(self) -> Operation<Handler, Inputs, Args, JsonOut>

Marks the inferred handler result for JSON interpretation.

Source

pub fn file(self) -> Operation<Handler, Inputs, Args, FileOut>

Marks the inferred handler result for streamed-file interpretation.

Trait Implementations§

Source§

impl<Handler: Debug, Inputs: Debug, Args: Debug, Transform: Debug> Debug for Operation<Handler, Inputs, Args, Transform>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Handler, Inputs, Args, Transform> Freeze for Operation<Handler, Inputs, Args, Transform>
where Handler: Freeze,

§

impl<Handler, Inputs, Args, Transform> RefUnwindSafe for Operation<Handler, Inputs, Args, Transform>
where Handler: RefUnwindSafe,

§

impl<Handler, Inputs, Args, Transform> Send for Operation<Handler, Inputs, Args, Transform>
where Handler: Send,

§

impl<Handler, Inputs, Args, Transform> Sync for Operation<Handler, Inputs, Args, Transform>
where Handler: Sync,

§

impl<Handler, Inputs, Args, Transform> Unpin for Operation<Handler, Inputs, Args, Transform>
where Handler: Unpin,

§

impl<Handler, Inputs, Args, Transform> UnsafeUnpin for Operation<Handler, Inputs, Args, Transform>
where Handler: UnsafeUnpin,

§

impl<Handler, Inputs, Args, Transform> UnwindSafe for Operation<Handler, Inputs, Args, Transform>
where Handler: UnwindSafe,

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> 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<This> HttpProgramExt<This> for This

Source§

fn compile_http<Program>( &self, program: Program, ) -> <Program as HttpProgramAlg<This>>::Route
where Program: HttpProgramAlg<This>,

Compiles a named HTTP program with this interpreter.

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, 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.