Trait distant_net::ServerRef
source · [−]pub trait ServerRef: AsAny + Send {
fn state(&self) -> &ServerState;
fn is_finished(&self) -> bool;
fn abort(&self);
fn wait(self) -> Pin<Box<dyn Future<Output = Result<()>>>>
where
Self: Sized + 'static,
{ ... }
}
Expand description
Interface to engage with a server instance
Required Methods
sourcefn state(&self) -> &ServerState
fn state(&self) -> &ServerState
Returns a reference to the state of the server
sourcefn is_finished(&self) -> bool
fn is_finished(&self) -> bool
Returns true if the server is no longer running
Provided Methods
Implementations
sourceimpl dyn ServerRef
impl dyn ServerRef
sourcepub fn as_server_ref<R: ServerRef>(&self) -> Option<&R>
pub fn as_server_ref<R: ServerRef>(&self) -> Option<&R>
Attempts to convert this ref into a concrete ref by downcasting
sourcepub fn as_mut_server_ref<R: ServerRef>(&mut self) -> Option<&mut R>
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
Implementors
impl ServerRef for GenericServerRef
Runtime-specific implementation of ServerRef
for a tokio::task::JoinHandle