pub struct MultiStrategy {
strategies: Vec<Box<dyn Strategy + Send>>,
}Expand description
Runs a group of sub-strategies concurrently, each in its own async task.
MultiStrategy is strategy-kind-agnostic: it only knows about
Box<dyn Strategy + Send>. Any type implementing Strategy — including
ones defined outside this crate — can be composed here.
Fields§
§strategies: Vec<Box<dyn Strategy + Send>>Implementations§
Source§impl MultiStrategy
impl MultiStrategy
Sourcepub fn new(strategies: Vec<Box<dyn Strategy + Send>>) -> Self
pub fn new(strategies: Vec<Box<dyn Strategy + Send>>) -> Self
Creates a new MultiStrategy from pre-built strategy objects.
Strategies are passed in already constructed; MultiStrategy does not know or
care about the concrete types. Pass an empty strategies vec to get a passive
strategy that blocks forever.
Trait Implementations§
Source§impl Debug for MultiStrategy
impl Debug for MultiStrategy
Source§impl Display for MultiStrategy
impl Display for MultiStrategy
Auto Trait Implementations§
impl Freeze for MultiStrategy
impl !RefUnwindSafe for MultiStrategy
impl Send for MultiStrategy
impl !Sync for MultiStrategy
impl Unpin for MultiStrategy
impl !UnwindSafe for MultiStrategy
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.