pub struct PromiscuousStrategy<Db, A>{ /* private fields */ }
Expand description
This strategy opens outgoing channels to peers, which have quality above a given threshold. At the same time, it closes outgoing channels opened to peers whose quality dropped below this threshold.
Implementations§
Source§impl<Db, A> PromiscuousStrategy<Db, A>
impl<Db, A> PromiscuousStrategy<Db, A>
pub fn new( cfg: PromiscuousStrategyConfig, db: Db, hopr_chain_actions: A, ) -> Self
Trait Implementations§
Source§impl<Db, A> Debug for PromiscuousStrategy<Db, A>
impl<Db, A> Debug for PromiscuousStrategy<Db, A>
Source§impl<Db, A> Display for PromiscuousStrategy<Db, A>
impl<Db, A> Display for PromiscuousStrategy<Db, A>
Source§impl<Db, A> SingularStrategy for PromiscuousStrategy<Db, A>
impl<Db, A> SingularStrategy for PromiscuousStrategy<Db, A>
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: Sync + '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: Sync + '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: Sync + '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: Sync + '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<Db, A> Freeze for PromiscuousStrategy<Db, A>
impl<Db, A> RefUnwindSafe for PromiscuousStrategy<Db, A>where
Db: RefUnwindSafe,
A: RefUnwindSafe,
impl<Db, A> Send for PromiscuousStrategy<Db, A>
impl<Db, A> Sync for PromiscuousStrategy<Db, A>
impl<Db, A> Unpin for PromiscuousStrategy<Db, A>
impl<Db, A> UnwindSafe for PromiscuousStrategy<Db, A>where
Db: UnwindSafe,
A: UnwindSafe,
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