pub trait ActionPublisher<A, Error> {
// Required method
fn publish(
&self,
action: &[A],
) -> impl Future<Output = Result<Vec<A>, Error>> + Send;
}
Expand description
Publishes the action/command to some external system.
Generic parameter:
A
. - actionError
- error
Required Methods§
Sourcefn publish(
&self,
action: &[A],
) -> impl Future<Output = Result<Vec<A>, Error>> + Send
fn publish( &self, action: &[A], ) -> impl Future<Output = Result<Vec<A>, Error>> + Send
Publishes the action/command to some external system, returning either the actions that are successfully published or error.
Desugared async fn publish(&self, action: &[A]) -> Result<Vec<A>, Error>;
to a normal fn
that returns impl Future
, and adds bound Send
.
You can freely move between the async fn
and -> impl Future
spelling in your traits and impls. This is true even when one form has a Send bound.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.