pub struct Server { /* private fields */ }
Available on crate feature
server
only.Expand description
The server struct.
Implementations§
Source§impl Server
impl Server
Sourcepub async fn bind_with<F: Future<Output = Result<()>>>(
self,
wait: impl FnOnce() -> F + Send + Sync + 'static,
) -> Result<()>
pub async fn bind_with<F: Future<Output = Result<()>>>( self, wait: impl FnOnce() -> F + Send + Sync + 'static, ) -> Result<()>
Start the server by running the timer in a dedicated thread as well as all the binders in dedicated threads.
The main thread is then blocked by the given wait
closure.
Sourcepub async fn bind(self) -> Result<()>
pub async fn bind(self) -> Result<()>
Wrapper around Server::bind_with
where the wait
closure
sleeps every second in an infinite loop.
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<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