pub struct Handle<S: Server> {
sender: Sender<CommandRequest<S>>,
discovery_limiter: DiscoveryLimiter,
}Expand description
Fields§
§sender: Sender<CommandRequest<S>>To send commands to the server
discovery_limiter: DiscoveryLimiterTo coordinate the handling of discovery requests
Implementations§
Source§impl<S: Server> Handle<S>
impl<S: Server> Handle<S>
Sourcepub(crate) async fn issue_command(&self, command: Command<S>) -> Result<(), ()>
pub(crate) async fn issue_command(&self, command: Command<S>) -> Result<(), ()>
Issues command to Runner. Waits for the command to be next in line, but does not wait for the command to be completed.
May return Err(()) when another command shutdown the server before this
command could be executed.
When Ok(()) is returned, this means the command is guaranteed to be executed momentarily.
pub async fn modify( &self, display: impl Display + Send + 'static, modifier: impl FnOnce(&mut S) -> bool + Send + 'static, ) -> Result<(), ()>
Sourcepub async fn inspect<T: Send + 'static>(
&self,
display: impl Display + Send + 'static,
inspector: impl FnOnce(&S) -> T + Send + 'static,
) -> Result<T, ()>
pub async fn inspect<T: Send + 'static>( &self, display: impl Display + Send + 'static, inspector: impl FnOnce(&S) -> T + Send + 'static, ) -> Result<T, ()>
Executes inspector on the server instance, returning its result.
Returns Err(()) when the command or its result could not be sent, probably because the server was shutting down.
pub async fn request_discovery( &self, app: Rc<S::AppT>, ) -> Result<DiscoveryRunResp>
Trait Implementations§
Auto Trait Implementations§
impl<S> !Freeze for Handle<S>
impl<S> !RefUnwindSafe for Handle<S>
impl<S> Send for Handle<S>
impl<S> !Sync for Handle<S>
impl<S> Unpin for Handle<S>
impl<S> UnsafeUnpin for Handle<S>
impl<S> !UnwindSafe for Handle<S>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more