pub struct HttpRpcServer { /* private fields */ }Expand description
An HTTP-based nanorpc server.
Implementations§
Source§impl HttpRpcServer
impl HttpRpcServer
Sourcepub async fn bind(addr: SocketAddr) -> Result<Self>
pub async fn bind(addr: SocketAddr) -> Result<Self>
Creates a new HTTP server listening at the given address. Routing is currently not supported.
Sourcepub async fn run(&self, service: impl RpcService) -> Result<()>
pub async fn run(&self, service: impl RpcService) -> Result<()>
Runs the server, processing requests with the given RpcService, blocking indefinitely until a fatal failure happens. This must be run for the server to make any progress!
Auto Trait Implementations§
impl Freeze for HttpRpcServer
impl RefUnwindSafe for HttpRpcServer
impl Send for HttpRpcServer
impl Sync for HttpRpcServer
impl Unpin for HttpRpcServer
impl UnwindSafe for HttpRpcServer
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