pub trait ServerRef: AsAny + Send {
    // Required methods
    fn is_finished(&self) -> bool;
    fn shutdown(&self);

    // Provided method
    fn wait(self) -> Pin<Box<dyn Future<Output = Result<()>>>>
       where Self: Sized + 'static { ... }
}
Expand description

Interface to engage with a server instance.

Required Methods§

source

fn is_finished(&self) -> bool

Returns true if the server is no longer running.

source

fn shutdown(&self)

Sends a shutdown signal to the server.

Provided Methods§

source

fn wait(self) -> Pin<Box<dyn Future<Output = Result<()>>>>where Self: Sized + 'static,

Implementations§

source§

impl dyn ServerRef

source

pub fn as_server_ref<R: ServerRef>(&self) -> Option<&R>

Attempts to convert this ref into a concrete ref by downcasting

source

pub fn as_mut_server_ref<R: ServerRef>(&mut self) -> Option<&mut R>

Attempts to convert this mutable ref into a concrete mutable ref by downcasting

source

pub fn into_boxed_server_ref<R: ServerRef>( self: Box<Self> ) -> Result<Box<R>, Box<dyn Any>>

Attempts to convert this into a concrete, boxed ref by downcasting

source

pub async fn polling_wait(&self) -> Result<()>

Waits for the server to complete by continuously polling the finished state.

Implementors§