#[non_exhaustive]pub struct ServerHandle {
pub http_addr: Option<SocketAddr>,
pub https_addr: Option<SocketAddr>,
}Expand description
Handle an embedder holds to interact with a running server.
§Why it doesn’t expose a .restart()
The brief is specific: “restart は server crate の内部責務にしない”
(restart is not a server-crate responsibility). A ServerHandle
carries read-only introspection and a shutdown signal — nothing
more. If a change requires the listener to rebind a new port, the
embedder tears the server down and constructs a fresh one.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.http_addr: Option<SocketAddr>Address the HTTP listener is bound to, if any.
https_addr: Option<SocketAddr>Address the HTTPS listener is bound to, if any.
Trait Implementations§
Source§impl Clone for ServerHandle
impl Clone for ServerHandle
Source§fn clone(&self) -> ServerHandle
fn clone(&self) -> ServerHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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