pub struct Server { /* private fields */ }
Expand description
The server struct. This is consumed when run, so you will typically not hold onto this for longer periods of time.
Implementations§
Source§impl Server
impl Server
Sourcepub fn subscriptions(&self) -> Arc<SubscriptionCache>
pub fn subscriptions(&self) -> Arc<SubscriptionCache>
Get a reference to the SubscriptionCache containing all subscriptions on the server.
Sourcepub async fn run_with(self, listener: TcpListener) -> Result<(), String>
pub async fn run_with(self, listener: TcpListener) -> Result<(), String>
Run the server using a given TCP listener.
Note that the configured TCP endpoint is still used to create the endpoint
descriptions, you must properly set host
and port
even when using this.
This is useful for testing, as you can bind a TcpListener
to port 0
auto-assign
a port.
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