pub struct Server { /* private fields */ }
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
Available on crate feature
iroh-relay
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>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub async fn spawn<EC, EA>(config: ServerConfig<EC, EA>) -> Result<Self>
Starts the server.
Sourcepub async fn shutdown(self) -> Result<()>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
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<()>>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
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>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn https_addr(&self) -> Option<SocketAddr>
The socket address the HTTPS server is listening on.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
👎Deprecated: This crate has been renamed from ‘iroh-net’ to ‘iroh’, please use the new crate
pub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN server is listening on.
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§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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