pub struct SimpleApi { /* private fields */ }Implementations§
Source§impl SimpleApi
impl SimpleApi
pub fn new() -> Self
pub fn instance() -> &'static SimpleApi
pub fn routes() -> Arc<Mutex<Vec<Arc<dyn View>>>> ⓘ
pub fn middlewares() -> Arc<Mutex<Vec<Arc<dyn Middleware>>>> ⓘ
pub fn session_provider() -> Arc<Mutex<Option<Arc<dyn SessionProvider>>>> ⓘ
pub fn state() -> Arc<Mutex<State>> ⓘ
pub async fn add_route<T: Any + View>(view: T)
pub async fn run(addr: &str)
pub async fn add_middleware(m: Arc<dyn Middleware>)
pub async fn set_session_provider(provider: Arc<dyn SessionProvider>)
pub async fn set_state(state: State)
Auto Trait Implementations§
impl Freeze for SimpleApi
impl !RefUnwindSafe for SimpleApi
impl Send for SimpleApi
impl Sync for SimpleApi
impl Unpin for SimpleApi
impl UnsafeUnpin for SimpleApi
impl !UnwindSafe for SimpleApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more