pub struct Executor;Expand description
An executor that runs commands through the host.
A handle with nothing in it: every run reaches the same process-global registry, so cloning is free and an instance taken before the server started works exactly as well as one taken after.
Trait Implementations§
Source§impl CommandExecutor for Executor
impl CommandExecutor for Executor
type Error = Error
type Stream<T> = Pin<Box<dyn Stream<Item = Result<T, Error>> + Send>> where T: Send + 'static
async fn execute<R, T>(
&self,
request: R,
_identity: Option<&Identity>,
) -> Result<Self::Stream<T>, Error>where
R: CommandRequest + Send + Serialize,
T: CommandResponse + Serialize + DeserializeOwned + Send + 'static,
Source§async fn execute_one<R, T>(
&self,
request: R,
identity: Option<&Identity>,
) -> Result<T, Error>where
R: CommandRequest + Send + Serialize,
T: CommandResponse + Serialize + DeserializeOwned + Send + 'static,
async fn execute_one<R, T>(
&self,
request: R,
identity: Option<&Identity>,
) -> Result<T, Error>where
R: CommandRequest + Send + Serialize,
T: CommandResponse + Serialize + DeserializeOwned + Send + 'static,
Convenience for unary commands: run the request and resolve the
first item from the stream. Implementations should error with
their own “empty stream” variant if the stream closes without
producing an item.
impl Copy for Executor
Auto Trait Implementations§
impl Freeze for Executor
impl RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnsafeUnpin for Executor
impl UnwindSafe for Executor
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