sark-core 0.26.2

Fiber-free request, route, dispatch, and lifecycle core for Sark
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core::convert::Infallible;

/// The exact result of a guard that ended admission.
pub trait Stop<T, E> {
    fn into_result(self) -> Result<T, E>;
}

impl<T, E> Stop<T, E> for Infallible {
    fn into_result(self) -> Result<T, E> {
        match self {}
    }
}

impl<T, E> Stop<T, E> for Result<T, E> {
    fn into_result(self) -> Result<T, E> {
        self
    }
}