Struct sos_server::Server
source · pub struct Server { /* private fields */ }Expand description
Web server implementation.
Implementations§
source§impl Server
impl Server
sourcepub async fn new(path: impl AsRef<Path>) -> Result<Self>
pub async fn new(path: impl AsRef<Path>) -> Result<Self>
Create a new server.
Path should be the directory where the backend will store account files; if a server is already running and has a lock on the directory this will block until the lock is released.
sourcepub async fn start(
&self,
addr: SocketAddr,
state: ServerState,
backend: ServerBackend,
handle: Handle,
) -> Result<()>
pub async fn start( &self, addr: SocketAddr, state: ServerState, backend: ServerBackend, handle: Handle, ) -> Result<()>
Start the server.
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more