Struct sshx_server::Server
source · pub struct Server { /* private fields */ }
Expand description
Stateful object that manages the sshx server, with graceful termination.
Implementations§
source§impl Server
impl Server
sourcepub fn new(options: ServerOptions) -> Result<Self>
pub fn new(options: ServerOptions) -> Result<Self>
Create a new application server, but do not listen for connections yet.
sourcepub fn state(&self) -> Arc<ServerState>
pub fn state(&self) -> Arc<ServerState>
Returns the server’s state object.
sourcepub async fn listen(&self, incoming: AddrIncoming) -> Result<()>
pub async fn listen(&self, incoming: AddrIncoming) -> Result<()>
Run the application server, listening on a stream of connections.
sourcepub async fn bind(&self, addr: &SocketAddr) -> Result<()>
pub async fn bind(&self, addr: &SocketAddr) -> Result<()>
Convenience function to call Server::listen
bound to a TCP address.
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe 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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request