pub struct Server { /* private fields */ }Implementations§
Source§impl Server
impl Server
pub fn new() -> Self
pub fn host(&mut self, host: &'static str) -> &mut Self
pub fn port(&mut self, port: usize) -> &mut Self
pub fn thread_pool_size(&mut self, thread_pool_size: usize) -> &mut Self
pub fn log_dir(&mut self, log_dir: &'static str) -> &mut Self
pub fn log_size(&mut self, log_size: usize) -> &mut Self
pub fn router<F>(&mut self, route: &'static str, func: F) -> &mut Self
pub fn middleware<F>(&mut self, func: F) -> &mut Self
pub fn listen(&mut self) -> &mut Self
Source§impl Server
impl Server
pub fn get_cfg(&self) -> &ArcRwLock<ServerConfig<'static>>
pub fn set_cfg(&mut self, val: ArcRwLock<ServerConfig<'static>>) -> &mut Self
pub fn get_router_func( &self, ) -> &ArcRwLock<HashMap<&'static str, Box<dyn Fn(&mut ControllerData) + Send + Sync + 'static>>>
pub fn set_router_func( &mut self, val: ArcRwLock<HashMap<&'static str, Box<dyn Fn(&mut ControllerData) + Send + Sync + 'static>>>, ) -> &mut Self
pub fn get_middleware( &self, ) -> &ArcRwLock<Vec<Box<dyn Fn(&mut ControllerData) + Send + Sync + 'static>>>
pub fn set_middleware( &mut self, val: ArcRwLock<Vec<Box<dyn Fn(&mut ControllerData) + Send + Sync + 'static>>>, ) -> &mut Self
pub fn get_tmp(&self) -> &ArcRwLock<Tmp>
pub fn set_tmp(&mut self, val: ArcRwLock<Tmp>) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
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