Struct iroh_relay::server::Server
source · pub struct Server { /* private fields */ }
Available on crate feature
server
only.Expand description
A running Relay + STUN server.
This is a full Relay server, including STUN, Relay and various associated HTTP services.
Dropping this will stop the server.
Implementations§
source§impl Server
impl Server
sourcepub async fn spawn<EC, EA>(config: ServerConfig<EC, EA>) -> Result<Self>
pub async fn spawn<EC, EA>(config: ServerConfig<EC, EA>) -> Result<Self>
Starts the server.
sourcepub async fn shutdown(self) -> Result<()>
pub async fn shutdown(self) -> Result<()>
Requests graceful shutdown.
Returns once all server tasks have stopped.
sourcepub fn task_handle(&mut self) -> &mut AbortOnDropHandle<Result<()>>
pub fn task_handle(&mut self) -> &mut AbortOnDropHandle<Result<()>>
Returns the handle for the task.
This allows waiting for the server’s supervisor task to finish. Can be useful in case there is an error in the server before it is shut down.
sourcepub fn https_addr(&self) -> Option<SocketAddr>
pub fn https_addr(&self) -> Option<SocketAddr>
The socket address the HTTPS server is listening on.
sourcepub fn http_addr(&self) -> Option<SocketAddr>
pub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
sourcepub fn quic_addr(&self) -> Option<SocketAddr>
pub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
sourcepub fn stun_addr(&self) -> Option<SocketAddr>
pub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN server is listening on.
sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
pub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
Trait Implementations§
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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