pub struct MultiStrategy { /* private fields */ }
Expand description
Defines an execution chain of SingularStrategies
.
The MultiStrategy
itself also implements the SingularStrategy
trait,
which makes it possible (along with different on_fail_continue
policies) to construct
various logical strategy chains.
Implementations§
Source§impl MultiStrategy
impl MultiStrategy
Sourcepub fn new<Db>(
cfg: MultiStrategyConfig,
db: Db,
hopr_chain_actions: ChainActions<Db>,
ticket_aggregator: Arc<dyn TicketAggregatorTrait + Send + Sync + 'static>,
) -> Self
pub fn new<Db>( cfg: MultiStrategyConfig, db: Db, hopr_chain_actions: ChainActions<Db>, ticket_aggregator: Arc<dyn TicketAggregatorTrait + Send + Sync + 'static>, ) -> Self
Constructs new MultiStrategy
.
The strategy can contain another MultiStrategy
if allow_recursive
is set.
Trait Implementations§
Source§impl Debug for MultiStrategy
impl Debug for MultiStrategy
Source§impl Display for MultiStrategy
impl Display for MultiStrategy
Source§impl SingularStrategy for MultiStrategy
impl SingularStrategy for MultiStrategy
Source§fn on_tick<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_tick<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Strategy event raised at period intervals (typically each 1 minute).
Source§fn on_acknowledged_winning_ticket<'life0, 'life1, 'async_trait>(
&'life0 self,
ack: &'life1 AcknowledgedTicket,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_acknowledged_winning_ticket<'life0, 'life1, 'async_trait>(
&'life0 self,
ack: &'life1 AcknowledgedTicket,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Strategy event raised when a new winning acknowledged ticket is received in a channel
Source§fn on_own_channel_changed<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 ChannelEntry,
direction: ChannelDirection,
change: ChannelChange,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_own_channel_changed<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 ChannelEntry,
direction: ChannelDirection,
change: ChannelChange,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Strategy event raised whenever the Indexer registers a change on node’s own channel.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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.
§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP