pub struct RpcServer<F>where
F: ServerFacts,{ /* private fields */ }Expand description
An RpcServer that listen, accept, and server connections, according to ServerFacts interface.
Implementations§
Source§impl<F> RpcServer<F>where
F: ServerFacts,
impl<F> RpcServer<F>where
F: ServerFacts,
pub fn new(facts: Arc<F>) -> Self
pub async fn listen<T: ServerTransport, D: Dispatch>( &mut self, addr: &str, dispatch: D, ) -> Result<String>
Sourcepub async fn close(&mut self)
pub async fn close(&mut self)
Gracefully close the server
Steps:
- listeners coroutine is abort
- drop the close channel to notify connection read coroutines.
- the writer coroutines will exit after all the reference of RespNoti channel drop to 0
- wait for connection coroutines to exit with a timeout defined by ServerConfig.server_close_wait
Auto Trait Implementations§
impl<F> !Freeze for RpcServer<F>
impl<F> !RefUnwindSafe for RpcServer<F>
impl<F> Send for RpcServer<F>
impl<F> Sync for RpcServer<F>
impl<F> Unpin for RpcServer<F>
impl<F> !UnwindSafe for RpcServer<F>
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