Struct product_os_server::ProductOSServer
source · pub struct ProductOSServer<S> { /* private fields */ }Implementations§
source§impl ProductOSServer<()>
impl ProductOSServer<()>
pub fn new_with_config(config: Configuration) -> Self
pub fn new() -> Self
source§impl<S> ProductOSServer<S>
impl<S> ProductOSServer<S>
pub fn new_with_state_and_config(config: Configuration, state: S) -> Self
pub fn new_with_state(state: 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, service_handler: MethodRouter<S>)
pub fn set_fallback(&mut self, service_handler: MethodRouter<S>)
pub fn add_get<H, T>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn add_post<H, T>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn add_handler<H, T>(&mut self, path: &str, method: Method, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn set_fallback_handler<H, T>(&mut self, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn add_handlers<H, T>(&mut self, path: &str, handlers: BTreeMap<Method, H>)where
H: Handler<T, S>,
T: 'static,
pub fn add_middleware<L, NewResBody>(&mut self, middleware: L)where
L: Layer<Route> + 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_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 async fn start(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>
Auto Trait Implementations§
impl<S> Freeze for ProductOSServer<S>where
S: Freeze,
impl<S> !RefUnwindSafe for ProductOSServer<S>
impl<S> Send for ProductOSServer<S>where
S: Send,
impl<S> Sync for ProductOSServer<S>where
S: Sync,
impl<S> Unpin for ProductOSServer<S>where
S: Unpin,
impl<S> !UnwindSafe for ProductOSServer<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