RouterSetter

Struct RouterSetter 

Source
pub struct RouterSetter<R, Sw, Ex> { /* private fields */ }
Expand description

Router editing environment.

You don’t need to understand this type, it’s here just for list it’s function. See Router document for api design and usage.

Implementations§

Source§

impl<R, Ex> RouterSetter<R, SetTableItem, Ex>
where R: RouterLike<Ex>,

Source

pub fn endpoint(self) -> RouterSetter<Self, SetEndpoint, Ex>

Enter endpoint edit environment.

Source

pub fn at<P: Into<Cow<'static, str>>>( self, path: P, ) -> RouterSetter<RouterSetter<Self, SetTableItem, Ex>, SetEndpoint, Ex>

Add a new item for path to router table and enter endpoint edit environment of that item.

Source

pub fn fallback(self) -> RouterSetter<Self, SetFallback, Ex>

Enter fallback edit environment.

Source

pub fn done(self) -> R
where Ex: Send + Sync + 'static,

Finish this router table editing.

Source§

impl<R, Ex> RouterSetter<RouterSetter<R, SetTableItem, Ex>, SetEndpoint, Ex>
where R: RouterLike<Ex>, Ex: Send + Sync + 'static,

Source

pub fn fallback( self, ) -> RouterSetter<RouterSetter<R, SetTableItem, Ex>, SetFallback, Ex>

Change to fallback editing environment.

Source

pub fn at<P: Into<Cow<'static, str>>>( self, path: P, ) -> RouterSetter<RouterSetter<RouterSetter<R, SetTableItem, Ex>, SetTableItem, Ex>, SetEndpoint, Ex>

Change to inner router’s router table table editing environment.

Source

pub fn is<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

Finish setting uses middleware.

Source§

impl<R, Sw, Ex> RouterSetter<R, Sw, Ex>
where R: RouterLike<Ex>, Sw: SetWhich<Ex>, Ex: Send + Sync + 'static,

Source

pub fn method<M: Middleware<Ex> + 'static>( self, method: Method, middleware: M, ) -> R

Finish editing use a method router which accept method and uses middleware.

Source

pub fn get<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Get, middleware), see Self::method.

Source

pub fn head<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Head, middleware), see Self::method.

Source

pub fn post<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Post, middleware), see Self::method.

Source

pub fn put<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Put, middleware), see Self::method.

Source

pub fn delete<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Delete, middleware), see Self::method.

Source

pub fn connect<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Connect, middleware), see Self::method.

Source

pub fn options<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Options, middleware), see Self::method.

Source

pub fn trace<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Trace, middleware), see Self::method.

Source

pub fn patch<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

A shortcut of self.method(Method::Patch, middleware), see Self::method.

Source

pub fn uses<M: Middleware<Ex> + 'static>(self, middleware: M) -> R

Finish editing use a middleware.

Auto Trait Implementations§

§

impl<R, Sw, Ex> Freeze for RouterSetter<R, Sw, Ex>
where R: Freeze, Sw: Freeze,

§

impl<R, Sw, Ex> !RefUnwindSafe for RouterSetter<R, Sw, Ex>

§

impl<R, Sw, Ex> Send for RouterSetter<R, Sw, Ex>
where R: Send, Sw: Send,

§

impl<R, Sw, Ex> Sync for RouterSetter<R, Sw, Ex>
where R: Sync, Sw: Sync,

§

impl<R, Sw, Ex> Unpin for RouterSetter<R, Sw, Ex>
where R: Unpin, Sw: Unpin,

§

impl<R, Sw, Ex> !UnwindSafe for RouterSetter<R, Sw, Ex>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,