[][src]Enum octane::router::Flow

pub enum Flow {
    Stop,
    Next,
}

The flow enum works just like the next() callback in express. The variant returns decides wheather the exection should go to the next similar route or not

Example

use octane::server::Octane;
use octane::{route, router::{Flow, Route}};

let mut app = Octane::new();
app.get(
    "/",
    route!(
        |req, res| {
            res.send("Hello, World");
            Flow::Stop
        }
    ),
);

Variants

Stop
Next

Implementations

impl Flow[src]

pub fn should_continue(self) -> bool[src]

Returns true if the variant is Flow::Next

Trait Implementations

impl Clone for Flow[src]

impl Copy for Flow[src]

impl Debug for Flow[src]

Auto Trait Implementations

impl RefUnwindSafe for Flow

impl Send for Flow

impl Sync for Flow

impl Unpin for Flow

impl UnwindSafe for Flow

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.