pub struct Server {
pub app_state: AppState,
pub http_addr: Option<SocketAddr>,
pub https_addr: Option<SocketAddr>,
}Expand description
HTTP(S) server.
Fields§
§app_state: AppState§http_addr: Option<SocketAddr>§https_addr: Option<SocketAddr>Implementations§
Source§impl Server
impl Server
Sourcepub async fn new(config: Config) -> ServerResult<Self>
pub async fn new(config: Config) -> ServerResult<Self>
Resolve listener addresses and build the server shell.
Also compiles Rhai middlewares listed in
config.service.middlewares_file_paths. Compilation happens here
(not in the config crate) because the compiled artefact is a
runtime object — see the server-level module docstring.
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin 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