pub struct HostServer { /* private fields */ }Expand description
A running host server. It owns the listener and app actor; dropping it
aborts both background tasks, while Self::shutdown gives them a clean
cancellation opportunity first.
Implementations§
Source§impl HostServer
impl HostServer
Sourcepub async fn bind(app: App, config: HostConfig) -> Result<Self>
pub async fn bind(app: App, config: HostConfig) -> Result<Self>
Bind a loopback host listener and start the app actor.
Sourcepub const fn local_addr(&self) -> SocketAddr
pub const fn local_addr(&self) -> SocketAddr
The loopback address selected by the OS.
Sourcepub fn subscribe(&self) -> Receiver<WireEvent>
pub fn subscribe(&self) -> Receiver<WireEvent>
Subscribe to the global app event stream. Each subscriber receives
events emitted after it subscribes; slow subscribers may be told they
lagged and should refresh from /v1/snapshot.
Trait Implementations§
Source§impl Drop for HostServer
impl Drop for HostServer
Auto Trait Implementations§
impl !RefUnwindSafe for HostServer
impl !UnwindSafe for HostServer
impl Freeze for HostServer
impl Send for HostServer
impl Sync for HostServer
impl Unpin for HostServer
impl UnsafeUnpin for HostServer
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.