pub trait Network:
Send
+ Sync
+ 'static {
// Required methods
fn broadcast<'life0, 'life1, 'async_trait>(
&'life0 self,
msg: &'life1 Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn flood_request<'life0, 'life1, 'async_trait>(
&'life0 self,
msg_inv: &'life1 Inv,
ttl_as_sec: Option<u64>,
hops_limit: u16,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn send_to_peer<'life0, 'async_trait>(
&'life0 self,
msg: Message,
peer_addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_to_alive_peers<'life0, 'async_trait>(
&'life0 self,
msg: Message,
amount: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_route<'life0, 'async_trait>(
&'life0 mut self,
msg_type: u8,
queue: AsyncQueue<Message>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_filter<'life0, 'async_trait>(
&'life0 mut self,
msg_type: u8,
filter: BoxedFilter,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_info(&self) -> Result<String>;
fn public_addr(&self) -> &SocketAddr;
fn alive_nodes_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn wait_for_alive_nodes<'life0, 'async_trait>(
&'life0 self,
amount: usize,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Required Methods§
Sourcefn broadcast<'life0, 'life1, 'async_trait>(
&'life0 self,
msg: &'life1 Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn broadcast<'life0, 'life1, 'async_trait>(
&'life0 self,
msg: &'life1 Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Broadcasts a fire-and-forget message.
Sourcefn flood_request<'life0, 'life1, 'async_trait>(
&'life0 self,
msg_inv: &'life1 Inv,
ttl_as_sec: Option<u64>,
hops_limit: u16,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn flood_request<'life0, 'life1, 'async_trait>(
&'life0 self,
msg_inv: &'life1 Inv,
ttl_as_sec: Option<u64>,
hops_limit: u16,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Broadcasts a request message
Sourcefn send_to_peer<'life0, 'async_trait>(
&'life0 self,
msg: Message,
peer_addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_to_peer<'life0, 'async_trait>(
&'life0 self,
msg: Message,
peer_addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a message to a specified peer.
Sourcefn send_to_alive_peers<'life0, 'async_trait>(
&'life0 self,
msg: Message,
amount: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_to_alive_peers<'life0, 'async_trait>(
&'life0 self,
msg: Message,
amount: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends to random set of alive peers.
Sourcefn add_route<'life0, 'async_trait>(
&'life0 mut self,
msg_type: u8,
queue: AsyncQueue<Message>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_route<'life0, 'async_trait>(
&'life0 mut self,
msg_type: u8,
queue: AsyncQueue<Message>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Routes any message of the specified type to this queue.
Sourcefn add_filter<'life0, 'async_trait>(
&'life0 mut self,
msg_type: u8,
filter: BoxedFilter,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_filter<'life0, 'async_trait>(
&'life0 mut self,
msg_type: u8,
filter: BoxedFilter,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Moves a filter of a specified topic to Network.
Sourcefn public_addr(&self) -> &SocketAddr
fn public_addr(&self) -> &SocketAddr
Returns public address in Kadcast