pub struct Server { /* private fields */ }Implementations§
Source§impl Server
impl Server
pub fn local_addr(&self) -> SocketAddr
Sourcepub async fn run(self) -> Result<(), ServerError>
pub async fn run(self) -> Result<(), ServerError>
Accept connections until the task is cancelled.
§Errors
Returns an I/O error when accepting a connection fails.
Sourcepub async fn run_with_shutdown<F>(self, shutdown: F) -> Result<(), ServerError>
pub async fn run_with_shutdown<F>(self, shutdown: F) -> Result<(), ServerError>
Accept connections until shutdown resolves, then gracefully close them.
§Errors
Returns an I/O error when accepting a connection fails.
Auto Trait Implementations§
impl !Freeze for Server
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin 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