Struct Router

Source
pub struct Router<TCtx = ()> { /* private fields */ }
Expand description

TODO: Examples exporting types and with rspc_axum

Implementations§

Source§

impl<TCtx> Router<TCtx>

Source

pub fn new() -> Self

Source

pub fn procedure( self, key: impl Into<Cow<'static, str>>, procedure: impl Into<ErasedProcedure<TCtx>>, ) -> Self

Source

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

Source

pub fn nest(self, prefix: impl Into<Cow<'static, str>>, other: Self) -> Self

Source

pub fn merge(self, other: Self) -> Self

Source

pub fn build( self, ) -> Result<(Procedures<TCtx>, Types), Vec<DuplicateProcedureKeyError>>

Trait Implementations§

Source§

impl<TCtx> Debug for Router<TCtx>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<TCtx> Default for Router<TCtx>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<TCtx> From<Router<TCtx>> for Router<TCtx>

Available on crate feature legacy only.
Source§

fn from(router: Router<TCtx>) -> Self

Converts to this type from the input type.
Source§

impl<'a, TCtx> IntoIterator for &'a Router<TCtx>

Source§

type Item = (&'a Vec<Cow<'static, str>>, &'a ErasedProcedure<TCtx>)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, Vec<Cow<'static, str>>, ErasedProcedure<TCtx>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<TCtx> Freeze for Router<TCtx>

§

impl<TCtx = ()> !RefUnwindSafe for Router<TCtx>

§

impl<TCtx = ()> !Send for Router<TCtx>

§

impl<TCtx = ()> !Sync for Router<TCtx>

§

impl<TCtx> Unpin for Router<TCtx>

§

impl<TCtx = ()> !UnwindSafe for Router<TCtx>

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.