pub struct Server<C>{ /* private fields */ }Implementations§
Source§impl<C> Server<C>
impl<C> Server<C>
pub fn new(config: Arc<C>, server_state: ServerState) -> (Self, ServerGuard)
pub async fn run<F1, Fut1, F2, Fut2>(
self,
create_listener: F1,
connection_handler: F2,
) -> Result<(), CommonError>where
F1: Fn(Arc<C>) -> Fut1 + Send + Sync + 'static,
Fut1: Future<Output = Result<TcpListener, CommonError>> + Send + 'static,
F2: Fn(Arc<C>, Arc<ServerState>, TcpStream, SocketAddr) -> Fut2 + Send + Sync + Clone + 'static,
Fut2: Future<Output = Result<(), CommonError>> + Send + 'static,
Auto Trait Implementations§
impl<C> !RefUnwindSafe for Server<C>
impl<C> !UnwindSafe for Server<C>
impl<C> Freeze for Server<C>
impl<C> Send for Server<C>
impl<C> Sync for Server<C>
impl<C> Unpin for Server<C>
impl<C> UnsafeUnpin for Server<C>
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