Struct ProcedureBuilder

Source
pub struct ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult> { /* private fields */ }

Implementations§

Source§

impl<TRootCtx, TCtx, TError, TBaseInput, TInput, TBaseResult, TResult> ProcedureBuilder<TError, TRootCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>
where TError: Error, TRootCtx: 'static, TCtx: 'static, TInput: 'static, TBaseInput: 'static, TResult: 'static, TBaseResult: 'static,

Source

pub fn with<M: IntoMiddleware<TError, TRootCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>>( self, mw: M, ) -> ProcedureBuilder<TError, TRootCtx, M::TNextCtx, TBaseInput, M::I, TBaseResult, M::R>

Source

pub fn setup( self, func: impl FnOnce(&mut State, ProcedureMeta) + 'static, ) -> Self

Source

pub fn query<F: Future<Output = Result<TResult, TError>> + Send + 'static>( self, handler: impl Fn(TCtx, TInput) -> F + Send + Sync + 'static, ) -> Procedure<TRootCtx, TBaseInput, TBaseResult>

Source

pub fn mutation<F: Future<Output = Result<TResult, TError>> + Send + 'static>( self, handler: impl Fn(TCtx, TInput) -> F + Send + Sync + 'static, ) -> Procedure<TRootCtx, TBaseInput, TBaseResult>

Source§

impl<TRootCtx, TCtx, TError, TBaseInput, TInput, TBaseResult, TResult, S> ProcedureBuilder<TError, TRootCtx, TCtx, TBaseInput, TInput, TBaseResult, Stream<S>>
where TError: Error, TRootCtx: 'static, TCtx: 'static, TInput: 'static, TBaseInput: 'static, TResult: 'static, TBaseResult: 'static, S: Stream<Item = TResult> + 'static,

Source

pub fn subscription<F: Future<Output = Result<S, TError>> + Send + 'static>( self, handler: impl Fn(TCtx, TInput) -> F + Send + Sync + 'static, ) -> Procedure<TRootCtx, TBaseInput, Stream<S>>

Trait Implementations§

Source§

impl<TBaseCtx, TError, TCtx, TBaseInput, TInput, TBaseResult, TResult> Debug for ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult> Freeze for ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>

§

impl<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult> !RefUnwindSafe for ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>

§

impl<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult> !Send for ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>

§

impl<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult> !Sync for ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>

§

impl<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult> Unpin for ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>
where TBaseInput: Unpin, TBaseResult: Unpin,

§

impl<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult> !UnwindSafe for ProcedureBuilder<TError, TBaseCtx, TCtx, TBaseInput, TInput, TBaseResult, TResult>

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