pub struct Hopr<Chain, Graph, Net, TMgr> {
pub(crate) transport_id: OffchainKeypair,
pub(crate) chain_id: NodeOnchainIdentity,
pub(crate) cfg: HoprLibConfig,
pub(crate) state: Arc<AtomicHoprState>,
pub(crate) transport_api: HoprTransport<Chain, Graph, Net>,
pub(crate) chain_api: Chain,
pub(crate) ticket_event_subscribers: (Sender<TicketEvent>, InactiveReceiver<TicketEvent>),
pub(crate) ticket_manager: TMgr,
pub(crate) processes: AbortableList<HoprLibProcess>,
}Expand description
HOPR main object providing the entire HOPR node functionality
Instantiating this object creates all processes and objects necessary for
running the HOPR node. Once created, the node can be started using the
run() method.
Externally offered API should be enough to perform all necessary tasks with the HOPR node manually, but it is advised to create such a configuration that manual interaction is unnecessary.
As such, the hopr_lib serves mainly as an integration point into Rust programs.
Fields§
§transport_id: OffchainKeypair§chain_id: NodeOnchainIdentity§cfg: HoprLibConfig§state: Arc<AtomicHoprState>§transport_api: HoprTransport<Chain, Graph, Net>§chain_api: Chain§ticket_event_subscribers: (Sender<TicketEvent>, InactiveReceiver<TicketEvent>)§ticket_manager: TMgr§processes: AbortableList<HoprLibProcess>Implementations§
Source§impl<Chain, Graph, Net, TMgr> Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
impl<Chain, Graph, Net, TMgr> Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
pub fn config(&self) -> &HoprLibConfig
pub(crate) fn error_if_not_in_state( &self, state: HoprState, error: String, ) -> Result<()>
pub(crate) async fn connect_to_with_transport_config( &self, destination: Address, target: SessionTarget, cfg: SessionClientConfig, ) -> Result<(HoprSession, HoprSessionConfigurator), HoprLibError>
Source§impl<Chain, Graph, Net, TMgr> Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + ComponentStatusReporter + Clone + Send + Sync + 'static,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + NetworkGraphConnectivity<NodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
TMgr: Send + Sync + 'static,
impl<Chain, Graph, Net, TMgr> Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + ComponentStatusReporter + Clone + Send + Sync + 'static,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + NetworkGraphConnectivity<NodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
TMgr: Send + Sync + 'static,
Sourcepub fn component_statuses(&self) -> NodeComponentStatuses
pub fn component_statuses(&self) -> NodeComponentStatuses
Returns per-component health statuses for the node.
When the node has reached Running, the aggregate node_state is
derived from component statuses (Running → Degraded → Failed).
Trait Implementations§
Source§impl<Chain, Graph, Net, TMgr> HasChainApi for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> HasChainApi for Hopr<Chain, Graph, Net, TMgr>
Source§type ChainError = HoprLibError
type ChainError = HoprLibError
Error type for node-level chain operations (distinct from on-chain errors).
Source§fn identity(&self) -> &NodeOnchainIdentity
fn identity(&self) -> &NodeOnchainIdentity
Returns the node’s on-chain identity (node address, Safe address, module address).
Source§fn wait_for_on_chain_event<F>(
&self,
predicate: F,
context: String,
timeout: Duration,
) -> EventWaitResult<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>
fn wait_for_on_chain_event<F>( &self, predicate: F, context: String, timeout: Duration, ) -> EventWaitResult<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>
Spawns an asynchronous waiter that subscribes to [
ChainEvent]s
and resolves when predicate matches or timeout elapses.Source§impl<Chain, Graph, Net, TMgr> HasGraphView for Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + NetworkGraphConnectivity<NodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
impl<Chain, Graph, Net, TMgr> HasGraphView for Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + NetworkGraphConnectivity<NodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
Source§impl<Chain, Graph, Net, TMgr> HasNetworkView for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> HasNetworkView for Hopr<Chain, Graph, Net, TMgr>
Source§type NetworkView = HoprTransport<Chain, Graph, Net>
type NetworkView = HoprTransport<Chain, Graph, Net>
The concrete [
NetworkView] implementation.Source§fn network_view(&self) -> &Self::NetworkView
fn network_view(&self) -> &Self::NetworkView
Returns a reference to the network view.
Source§impl<Chain, Graph, Net, TMgr> HasTicketManagement for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> HasTicketManagement for Hopr<Chain, Graph, Net, TMgr>
Source§type TicketManager = TMgr
type TicketManager = TMgr
The concrete [
TicketManagement] implementation.Source§fn ticket_management(&self) -> &TMgr
fn ticket_management(&self) -> &TMgr
Returns a reference to the ticket manager.
Source§fn subscribe_ticket_events(
&self,
) -> impl Stream<Item = TicketEvent> + Send + 'static
fn subscribe_ticket_events( &self, ) -> impl Stream<Item = TicketEvent> + Send + 'static
Returns a stream of [
TicketEvent]s from the transport layer.Source§impl<Chain, Graph, Net, TMgr> HasTransportApi for Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
TMgr: Send + Sync + 'static,
impl<Chain, Graph, Net, TMgr> HasTransportApi for Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
TMgr: Send + Sync + 'static,
Source§impl<Chain, Graph, Net, TMgr> HoprNodeOperations for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> HoprNodeOperations for Hopr<Chain, Graph, Net, TMgr>
Source§fn status(&self) -> HoprState
fn status(&self) -> HoprState
Returns the runtime status of the node.
Source§impl<Chain, Graph, Net, TMgr> HoprSessionClientOperations for Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
TMgr: Send + Sync + 'static,
impl<Chain, Graph, Net, TMgr> HoprSessionClientOperations for Hopr<Chain, Graph, Net, TMgr>where
Chain: HoprChainApi + Clone + Send + Sync + 'static,
Graph: HoprGraphApi<HoprNodeId = OffchainPublicKey> + Clone + Send + Sync + 'static,
<Graph as NetworkGraphTraverse>::Observed: EdgeObservableRead + Send + 'static,
<Graph as NetworkGraphWrite>::Observed: EdgeObservableWrite + Send,
Net: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static,
TMgr: Send + Sync + 'static,
Source§type Config = HoprSessionClientConfig
type Config = HoprSessionClientConfig
Configuration for the session (routing, capabilities, etc.).
Source§type Error = HoprLibError
type Error = HoprLibError
Error type for session operations.
Source§type Session = HoprSession
type Session = HoprSession
An established session implementing async read/write.
Source§type SessionConfigurator = HoprSessionConfigurator
type SessionConfigurator = HoprSessionConfigurator
Handle for controlling a session after creation (e.g. keep-alive, SURB config).
Source§type Target = SessionTarget
type Target = SessionTarget
Describes the remote service to connect to.
Source§fn connect_to<'life0, 'async_trait>(
&'life0 self,
destination: Address,
target: Self::Target,
cfg: Self::Config,
) -> Pin<Box<dyn Future<Output = Result<(Self::Session, Self::SessionConfigurator), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect_to<'life0, 'async_trait>(
&'life0 self,
destination: Address,
target: Self::Target,
cfg: Self::Config,
) -> Pin<Box<dyn Future<Output = Result<(Self::Session, Self::SessionConfigurator), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Establishes a new session to the given
destination via the HOPR network. Read moreAuto Trait Implementations§
impl<Chain, Graph, Net, TMgr> Freeze for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> !RefUnwindSafe for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> Send for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> Sync for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> Unpin for Hopr<Chain, Graph, Net, TMgr>
impl<Chain, Graph, Net, TMgr> !UnwindSafe for Hopr<Chain, Graph, Net, TMgr>
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> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
§impl<T> IncentiveChannelOperations for T
impl<T> IncentiveChannelOperations for T
§const CHAIN_OPERATION_TIMEOUT_MULTIPLIER: u32 = 2
const CHAIN_OPERATION_TIMEOUT_MULTIPLIER: u32 = 2
Timeout multiplier applied to [
ChainValues::typical_resolution_time]
when waiting for on-chain operations to be confirmed via the event bus.§fn open_channel<'life0, 'async_trait, A>(
&'life0 self,
destination: A,
amount: Balance<WxHOPR>,
) -> Pin<Box<dyn Future<Output = Result<ChainOutput<HashBase<CoreWrapper<Keccak256Core>>>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>>> + Send + 'async_trait>>
fn open_channel<'life0, 'async_trait, A>( &'life0 self, destination: A, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<ChainOutput<HashBase<CoreWrapper<Keccak256Core>>>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>>> + Send + 'async_trait>>
Opens a channel from the node to the given
destination with the given amount as the initial stake.§fn fund_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>,
amount: Balance<WxHOPR>,
) -> Pin<Box<dyn Future<Output = Result<ChainOutput<()>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn fund_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>,
amount: Balance<WxHOPR>,
) -> Pin<Box<dyn Future<Output = Result<ChainOutput<()>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Funds an existing channel with the given
amount.§fn close_channel_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>,
) -> Pin<Box<dyn Future<Output = Result<ChainOutput<ChannelStatus>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn close_channel_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 HashBase<CoreWrapper<Keccak256Core>>,
) -> Pin<Box<dyn Future<Output = Result<ChainOutput<ChannelStatus>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, Self::ChainError>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Initiates or finalizes the closure of a channel.
§fn channel_by_id(
&self,
channel_id: &HashBase<CoreWrapper<Keccak256Core>>,
) -> Result<Option<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>
fn channel_by_id( &self, channel_id: &HashBase<CoreWrapper<Keccak256Core>>, ) -> Result<Option<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>
Returns a channel with the given
channel_id.§fn channel<A, B>(
&self,
source: A,
destination: B,
) -> Result<Option<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>
fn channel<A, B>( &self, source: A, destination: B, ) -> Result<Option<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>
Returns a channel between
source and destination.§fn channels_to<'life0, 'async_trait, A>(
&'life0 self,
destination: A,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
fn channels_to<'life0, 'async_trait, A>( &'life0 self, destination: A, ) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
Returns all channels to the given
destination.§fn channels_from<'life0, 'async_trait, A>(
&'life0 self,
source: A,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
fn channels_from<'life0, 'async_trait, A>( &'life0 self, source: A, ) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
Returns all channels from the given
source.§fn get_balance<'life0, 'async_trait, C>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance<C>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
fn get_balance<'life0, 'async_trait, C>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
Returns the balance of [
Currency] in the node’s account.§fn get_safe_balance<'life0, 'async_trait, C>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance<C>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
fn get_safe_balance<'life0, 'async_trait, C>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Balance<C>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
Returns the balance of [
Currency] in the node’s Safe.§fn safe_allowance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance<WxHOPR>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn safe_allowance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance<WxHOPR>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Returns the allowance of the node’s Safe to spend funds in channels.
§fn withdraw<'life0, 'life1, 'async_trait, C>(
&'life0 self,
recipient: &'life1 Address,
amount: Balance<C>,
) -> Pin<Box<dyn Future<Output = Result<ChainOutput<()>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
fn withdraw<'life0, 'life1, 'async_trait, C>( &'life0 self, recipient: &'life1 Address, amount: Balance<C>, ) -> Pin<Box<dyn Future<Output = Result<ChainOutput<()>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>
Withdraws the given
amount of [Currency] from the node to the recipient.§fn chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Returns information about the connected blockchain.
§fn get_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance<WxHOPR>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance<WxHOPR>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Returns the minimum ticket price from the blockchain.
§fn get_minimum_incoming_ticket_win_probability<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WinningProbability, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_minimum_incoming_ticket_win_probability<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WinningProbability, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Returns the minimum win probability of an incoming ticket.
§fn get_channel_closure_notice_period<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Duration, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_channel_closure_notice_period<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Duration, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Returns the channel closure grace period.
§fn announced_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountEntry>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn announced_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountEntry>, <Self::ChainApi as HoprChainApi>::ChainError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Returns all peers that have been publicly announced on-chain.
§impl<T> IncentiveRedeemOperations for T
impl<T> IncentiveRedeemOperations for T
§const PENDING_TO_CLOSE_REDEMPTION_TOLERANCE: Duration = _
const PENDING_TO_CLOSE_REDEMPTION_TOLERANCE: Duration = _
How long before the channel closure grace period elapses should we still try to redeem tickets.
§fn redeem_all_tickets<'life0, 'async_trait, B>(
&'life0 self,
min_value: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<RedemptionResult>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, <Self::TicketManager as TicketManagement>::Error>>> + Send + 'async_trait>>
fn redeem_all_tickets<'life0, 'async_trait, B>( &'life0 self, min_value: B, ) -> Pin<Box<dyn Future<Output = Result<Vec<RedemptionResult>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, <Self::TicketManager as TicketManagement>::Error>>> + Send + 'async_trait>>
Redeems all redeemable tickets in all incoming channels. Read more
§fn redeem_tickets_with_counterparty<'life0, 'async_trait, A, B>(
&'life0 self,
issuer: A,
min_value: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<RedemptionResult>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, <Self::TicketManager as TicketManagement>::Error>>> + Send + 'async_trait>>
fn redeem_tickets_with_counterparty<'life0, 'async_trait, A, B>( &'life0 self, issuer: A, min_value: B, ) -> Pin<Box<dyn Future<Output = Result<Vec<RedemptionResult>, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, <Self::TicketManager as TicketManagement>::Error>>> + Send + 'async_trait>>
Redeems all incoming tickets from the given issuer. Read more
§fn ticket_statistics(
&self,
) -> Result<ChannelStats, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, <Self::TicketManager as TicketManagement>::Error>>
fn ticket_statistics( &self, ) -> Result<ChannelStats, EitherErr<<Self::ChainApi as HoprChainApi>::ChainError, <Self::TicketManager as TicketManagement>::Error>>
Returns [
ChannelStats] for all incoming channels which have tickets.§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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.§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> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.