Struct product_os_server::ProductOSServerSimple
source · pub struct ProductOSServerSimple<S = ()> { /* private fields */ }Implementations§
source§impl<S> ProductOSServerSimple<S>where
S: Clone + Send + Sync + 'static,
impl<S> ProductOSServerSimple<S>where S: Clone + Send + Sync + 'static,
pub fn new_with_config_sync( config: Configuration, router: ProductOSRouter<S> ) -> Self
pub async fn new_with_config( config: Configuration, router: ProductOSRouter<S> ) -> Self
pub fn new(router: ProductOSRouter<S>) -> Self
pub fn set_logging(&mut self, log_level: Level)
pub fn set_certificate(&mut self, certificate: Option<Certificate>)
pub fn set_security(&mut self, security: Option<Security>)
pub fn get_router(&mut self) -> &mut ProductOSRouter<S>
pub fn add_route(&mut self, path: &str, method_router: MethodRouter<S>)
pub fn set_fallback(&mut self, method_router: MethodRouter<S>)
pub fn add_get<H, T>(&mut self, path: &str, handler: H)where H: Handler<T, S, Body>, T: 'static,
pub fn add_post<H, T>(&mut self, path: &str, handler: H)where H: Handler<T, S, Body>, T: 'static,
pub fn add_handler<H, T>(&mut self, path: &str, method: Method, handler: H)where H: Handler<T, S, Body>, T: 'static,
pub fn set_fallback_handler<H, T>(&mut self, handler: H)where H: Handler<T, S, Body>, T: 'static,
pub fn add_handlers<H, T>(&mut self, path: &str, handlers: HashMap<Method, H>)where H: Handler<T, S, Body>, T: 'static,
pub fn add_middleware<L, NewResBody>(&mut self, middleware: L)where L: Layer<Route<Body>> + Clone + Send + 'static, L::Service: Service<Request<Body>, Response = Response<NewResBody>, Error = Infallible> + Clone + Send + 'static, <L::Service as Service<Request<Body>>>::Future: Send + 'static, NewResBody: HttpBody<Data = Bytes> + Send + 'static, NewResBody::Error: Into<BoxError>,
pub fn set_router(&mut self, router: ProductOSRouter<S>)
pub async fn create_dual_service_server( &mut self, serve_on_main_thread: bool, custom_port: Option<u16>, custom_router: Option<Router>, with_connect_info: bool, force_secure: bool ) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn create_https_server( &mut self, serve_on_main_thread: bool, custom_port: Option<u16>, custom_router: Option<Router>, with_connect_info: bool ) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn create_http_server( &mut self, serve_on_main_thread: bool, custom_port: Option<u16>, custom_router: Option<Router>, with_connect_info: bool ) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn init_stores(&mut self)
pub fn get_config(&self) -> Configuration
pub fn update_config(&mut self, config: Configuration)
pub fn get_base_url(&self) -> Url
pub fn start_sync(&mut self) -> Result<Handle, Box<dyn Error + Send + Sync>>
pub async fn start(&mut self) -> Result<Handle, Box<dyn Error + Send + Sync>>
Auto Trait Implementations§
impl<S = ()> !RefUnwindSafe for ProductOSServerSimple<S>
impl<S> Send for ProductOSServerSimple<S>where S: Send,
impl<S = ()> !Sync for ProductOSServerSimple<S>
impl<S> Unpin for ProductOSServerSimple<S>where S: Unpin,
impl<S = ()> !UnwindSafe for ProductOSServerSimple<S>
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