pub struct LocalServer<H, T: LocalTransport> { /* private fields */ }Expand description
Single-threaded server instance for LocalTransport backends.
LocalServer::run must be polled inside a Tokio LocalSet (e.g.
from inside tokio_uring::start(async { server.run().await })).
Polling it from a context without a LocalSet will fail at the first
spawn_local call.
Implementations§
Source§impl<H, T> LocalServer<H, T>
impl<H, T> LocalServer<H, T>
Sourcepub async fn run(&mut self) -> Result<(), ServerError>
pub async fn run(&mut self) -> Result<(), ServerError>
Runs the server, accepting connections and processing messages.
§Errors
Returns ServerError if the listener fails to bind or the
accept loop encounters an unrecoverable error.
§Panics
Panics indirectly via tokio::task::spawn_local if called outside
a LocalSet context. See the type-level docs.
Auto Trait Implementations§
impl<H, T> !Freeze for LocalServer<H, T>
impl<H, T> !RefUnwindSafe for LocalServer<H, T>
impl<H, T> !Send for LocalServer<H, T>
impl<H, T> !Sync for LocalServer<H, T>
impl<H, T> Unpin for LocalServer<H, T>
impl<H, T> UnsafeUnpin for LocalServer<H, T>
impl<H, T> UnwindSafe for LocalServer<H, T>
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