pub struct ServerHandle {
pub addr: SocketAddr,
/* private fields */
}Expand description
Handle returned from serve. Use it to feed chunks and signal completion.
Fields§
§addr: SocketAddrBound address (use .port() to get the OS-assigned port).
Implementations§
Source§impl ServerHandle
impl ServerHandle
Sourcepub fn finish(&self)
pub fn finish(&self)
Signal that all input has been read.
In non-persist mode the server shuts down after the handler finishes
streaming the response. Call [wait_served] to wait for that before
exiting.
Sourcepub async fn wait_served(&self)
pub async fn wait_served(&self)
Wait until a response has been fully streamed to the browser. Returns immediately in persist mode (server stays alive until Ctrl-C).
Auto Trait Implementations§
impl Freeze for ServerHandle
impl !RefUnwindSafe for ServerHandle
impl Send for ServerHandle
impl Sync for ServerHandle
impl Unpin for ServerHandle
impl UnsafeUnpin for ServerHandle
impl !UnwindSafe for ServerHandle
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