pub struct ConnexaTask<X, C, S, T = (), K = MemoryKeystore>{Show 35 fields
pub swarm: Optional<Swarm<Behaviour<C, S>>>,
pub command_receiver: Optional<Receiver<Command<T>>>,
pub context: X,
pub custom_task_callback: Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, T) + Send + 'static>,
pub custom_event_callback: Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, <C as NetworkBehaviour>::ToSwarm) + Send + 'static>,
pub swarm_event_callback: Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &SwarmEvent<BehaviourEvent<C, S>>, &mut X) + Send + 'static>,
pub custom_pollable_callback: Box<dyn Fn(&mut Context<'_>, &mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X) -> Poll<()> + Send + 'static>,
pub keychain: Keychain<K>,
pub connection_listeners: Vec<Sender<ConnexaSwarmEvent>>,
pub listener_addresses: HashMap<ListenerId, Vec<Multiaddr>>,
pub dht_event_sender: IndexMap<RecordKey, Vec<Sender<DHTEvent>>>,
pub dht_event_global_sender: Vec<Sender<DHTEvent>>,
pub dht_put_record_receiver: StreamMap<RecordKey, FutureSet<Receiver<Record>>>,
pub dht_put_record_global_receiver: FutureSet<Receiver<Record>>,
pub dht_provider_record_receiver: StreamMap<RecordKey, FutureSet<Receiver<ProviderRecord>>>,
pub dht_provider_record_global_receiver: FutureSet<Receiver<ProviderRecord>>,
pub pending_dht_put_record: IndexMap<QueryId, Sender<ConnexaResult<()>>>,
pub pending_dht_put_provider_record: IndexMap<QueryId, Sender<ConnexaResult<()>>>,
pub pending_dht_get_record: IndexMap<QueryId, Sender<ConnexaResult<PeerRecord>>>,
pub pending_dht_get_provider_record: IndexMap<QueryId, Sender<ConnexaResult<HashSet<PeerId>>>>,
pub pending_dht_find_closest_peer: IndexMap<QueryId, Sender<ConnexaResult<Vec<PeerInfo>>>>,
pub pending_dht_bootstrap: IndexMap<QueryId, Sender<ConnexaResult<()>>>,
pub pending_connection: IndexMap<ConnectionId, Sender<ConnexaResult<ConnectionId>>>,
pub pending_disconnection_by_connection_id: IndexMap<ConnectionId, Sender<ConnexaResult<()>>>,
pub pending_disconnection_by_peer_id: IndexMap<PeerId, Sender<ConnexaResult<()>>>,
pub pending_listen_on: IndexMap<ListenerId, Sender<ConnexaResult<ListenerId>>>,
pub pending_remove_listener: IndexMap<ListenerId, Sender<ConnexaResult<()>>>,
pub gossipsub_listener: IndexMap<TopicHash, Vec<Sender<GossipsubEvent>>>,
pub floodsub_listener: IndexMap<Topic, Vec<Sender<FloodsubEvent>>>,
pub pending_rendezvous_register: IndexMap<(PeerId, Namespace), VecDeque<(Option<u64>, Sender<ConnexaResult<()>>)>>,
pub pending_rendezvous_discover: IndexMap<(PeerId, Option<Namespace>), VecDeque<(Option<Cookie>, Option<u64>, Sender<ConnexaResult<(Cookie, Vec<(PeerId, Vec<Multiaddr>)>)>>)>>,
pub gossipsub_can_propagate: FutureMap<(PeerId, MessageId), Receiver<Result<MessageAcceptance>>>,
pub peerstore_ops: FutureSet<BoxFuture<'static, ()>>,
pub cleanup_timer: Delay,
pub cleanup_interval: Duration,
}Fields§
§swarm: Optional<Swarm<Behaviour<C, S>>>§command_receiver: Optional<Receiver<Command<T>>>§context: X§custom_task_callback: Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, T) + Send + 'static>§custom_event_callback: Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, <C as NetworkBehaviour>::ToSwarm) + Send + 'static>§swarm_event_callback: Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &SwarmEvent<BehaviourEvent<C, S>>, &mut X) + Send + 'static>§custom_pollable_callback: Box<dyn Fn(&mut Context<'_>, &mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X) -> Poll<()> + Send + 'static>§keychain: Keychain<K>§connection_listeners: Vec<Sender<ConnexaSwarmEvent>>§listener_addresses: HashMap<ListenerId, Vec<Multiaddr>>§dht_event_sender: IndexMap<RecordKey, Vec<Sender<DHTEvent>>>A listener for sending dht events
dht_event_global_sender: Vec<Sender<DHTEvent>>§dht_put_record_receiver: StreamMap<RecordKey, FutureSet<Receiver<Record>>>§dht_put_record_global_receiver: FutureSet<Receiver<Record>>§dht_provider_record_receiver: StreamMap<RecordKey, FutureSet<Receiver<ProviderRecord>>>§dht_provider_record_global_receiver: FutureSet<Receiver<ProviderRecord>>§pending_dht_put_record: IndexMap<QueryId, Sender<ConnexaResult<()>>>§pending_dht_put_provider_record: IndexMap<QueryId, Sender<ConnexaResult<()>>>§pending_dht_get_record: IndexMap<QueryId, Sender<ConnexaResult<PeerRecord>>>§pending_dht_get_provider_record: IndexMap<QueryId, Sender<ConnexaResult<HashSet<PeerId>>>>§pending_dht_find_closest_peer: IndexMap<QueryId, Sender<ConnexaResult<Vec<PeerInfo>>>>§pending_dht_bootstrap: IndexMap<QueryId, Sender<ConnexaResult<()>>>§pending_connection: IndexMap<ConnectionId, Sender<ConnexaResult<ConnectionId>>>§pending_disconnection_by_connection_id: IndexMap<ConnectionId, Sender<ConnexaResult<()>>>§pending_disconnection_by_peer_id: IndexMap<PeerId, Sender<ConnexaResult<()>>>§pending_listen_on: IndexMap<ListenerId, Sender<ConnexaResult<ListenerId>>>§pending_remove_listener: IndexMap<ListenerId, Sender<ConnexaResult<()>>>§gossipsub_listener: IndexMap<TopicHash, Vec<Sender<GossipsubEvent>>>§floodsub_listener: IndexMap<Topic, Vec<Sender<FloodsubEvent>>>§pending_rendezvous_register: IndexMap<(PeerId, Namespace), VecDeque<(Option<u64>, Sender<ConnexaResult<()>>)>>§pending_rendezvous_discover: IndexMap<(PeerId, Option<Namespace>), VecDeque<(Option<Cookie>, Option<u64>, Sender<ConnexaResult<(Cookie, Vec<(PeerId, Vec<Multiaddr>)>)>>)>>§gossipsub_can_propagate: FutureMap<(PeerId, MessageId), Receiver<Result<MessageAcceptance>>>§peerstore_ops: FutureSet<BoxFuture<'static, ()>>§cleanup_timer: Delay§cleanup_interval: DurationImplementations§
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_autonat_v1_command(&mut self, command: AutonatCommand)
pub fn process_autonat_v1_event(&mut self, event: AutonatV1Event)
pub fn process_autonat_v2_client_event(&mut self, event: AutonatV2ClientEvent)
pub fn process_autonat_v2_server_event(&mut self, event: AutonatV2ServerEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_dcutr_event(&mut self, event: DcutrEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_floodsub_command(&mut self, command: FloodsubCommand)
pub fn process_floodsub_event(&mut self, event: Event)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_gossipsub_command(&mut self, command: GossipsubCommand)
pub fn process_gossipsub_event(&mut self, event: Event)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_identify_event(&mut self, event: IdentifyEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_kademlia_command(&mut self, command: DHTCommand)
pub fn process_kademlia_event(&mut self, event: KademliaEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_mdns_event(&mut self, event: MdnsEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_ping_event(&mut self, event: PingEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_autorelay_commands(&mut self, command: AutoRelayCommand)
pub fn process_relay_client_event(&mut self, event: RelayClientEvent)
pub fn process_relay_server_event(&mut self, event: RelayServerEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_relay_server_command(&mut self, command: RelayServerCommand)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_rendezvous_command(&mut self, command: RendezvousCommand)
pub fn process_rendezvous_server_event(&mut self, event: RendezvousServerEvent)
pub fn process_rendezvous_client_event(&mut self, event: RendezvousClientEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_request_response_command( &mut self, command: RequestResponseCommand, )
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_stream_command(&mut self, command: StreamCommand)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_swarm_event(&mut self, event: SwarmEvent<BehaviourEvent<C, S>>)
pub fn process_swarm_behaviour_event(&mut self, event: BehaviourEvent<C, S>)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn process_upnp_event(&mut self, event: UpnpEvent)
Source§impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> ConnexaTask<X, C, S, T, K>
pub fn new(swarm: Swarm<Behaviour<C, S>>, keychain: Keychain<K>) -> Self
pub fn set_context(&mut self, context: X)
pub fn set_command_receiver(&mut self, command_receiver: Receiver<Command<T>>)
pub fn set_event_callback<F>(&mut self, callback: F)
pub fn set_task_callback<F>(&mut self, callback: F)
pub fn set_swarm_event_callback<F>(&mut self, callback: F)where
F: Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &SwarmEvent<BehaviourEvent<C, S>>, &mut X) + 'static + Send,
pub fn set_pollable_callback<F>(&mut self, callback: F)
pub fn process_command(&mut self, command: Command<T>)
Trait Implementations§
Source§impl<X, C, S, T, K> Future for ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> Future for ConnexaTask<X, C, S, T, K>
Auto Trait Implementations§
impl<X, C, S, T = (), K = MemoryKeystore> !Freeze for ConnexaTask<X, C, S, T, K>
impl<X, C, S, T = (), K = MemoryKeystore> !RefUnwindSafe for ConnexaTask<X, C, S, T, K>
impl<X, C, S, T = (), K = MemoryKeystore> !Sync for ConnexaTask<X, C, S, T, K>
impl<X, C, S, T = (), K = MemoryKeystore> !UnwindSafe for ConnexaTask<X, C, S, T, K>
impl<X, C, S, T, K> Send for ConnexaTask<X, C, S, T, K>where
Optional<Swarm<Behaviour<C, S>>>: Send,
Optional<Receiver<Command<T>>>: Send,
X: Send,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, T) + Send>: Send,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, <C as NetworkBehaviour>::ToSwarm) + Send>: Send,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &SwarmEvent<BehaviourEvent<C, S>>, &mut X) + Send>: Send,
Box<dyn Fn(&mut Context<'_>, &mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X) -> Poll<()> + Send>: Send,
Keychain<K>: Send,
impl<X, C, S, T, K> Unpin for ConnexaTask<X, C, S, T, K>where
Optional<Swarm<Behaviour<C, S>>>: Unpin,
Optional<Receiver<Command<T>>>: Unpin,
X: Unpin,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, T) + Send>: Unpin,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, <C as NetworkBehaviour>::ToSwarm) + Send>: Unpin,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &SwarmEvent<BehaviourEvent<C, S>>, &mut X) + Send>: Unpin,
Box<dyn Fn(&mut Context<'_>, &mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X) -> Poll<()> + Send>: Unpin,
Keychain<K>: Unpin,
impl<X, C, S, T, K> UnsafeUnpin for ConnexaTask<X, C, S, T, K>where
Optional<Swarm<Behaviour<C, S>>>: UnsafeUnpin,
Optional<Receiver<Command<T>>>: UnsafeUnpin,
X: UnsafeUnpin,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, T) + Send>: UnsafeUnpin,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X, <C as NetworkBehaviour>::ToSwarm) + Send>: UnsafeUnpin,
Box<dyn Fn(&mut Swarm<Behaviour<C, S>>, &Keychain<K>, &SwarmEvent<BehaviourEvent<C, S>>, &mut X) + Send>: UnsafeUnpin,
Box<dyn Fn(&mut Context<'_>, &mut Swarm<Behaviour<C, S>>, &Keychain<K>, &mut X) -> Poll<()> + Send>: UnsafeUnpin,
Keychain<K>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
Map this future’s output to a different type, returning a new future of
the resulting type. Read more
Source§fn map_into<U>(self) -> MapInto<Self, U> ⓘ
fn map_into<U>(self) -> MapInto<Self, U> ⓘ
Map this future’s output to a different type, returning a new future of
the resulting type. Read more
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
Chain on a computation for when a future finished, passing the result of
the future to the provided closure
f. Read moreSource§fn left_future<B>(self) -> Either<Self, B> ⓘ
fn left_future<B>(self) -> Either<Self, B> ⓘ
Source§fn right_future<A>(self) -> Either<A, Self> ⓘ
fn right_future<A>(self) -> Either<A, Self> ⓘ
Source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Convert this future into a single element stream. Read more
Source§fn flatten(self) -> Flatten<Self> ⓘ
fn flatten(self) -> Flatten<Self> ⓘ
Flatten the execution of this future when the output of this
future is itself another future. Read more
Source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
Flatten the execution of this future when the successful result of this
future is a stream. Read more
Source§fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
Fuse a future such that
poll will never again be called once it has
completed. This method can be used to turn any Future into a
FusedFuture. Read moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
Do something with the output of a future before passing it on. Read more
Source§fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
Catches unwinding panics while polling the future. Read more
Create a cloneable handle to this future where all handles will resolve
to the same result. Read more
Source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
Turn this future into a future that yields
() on completion and sends
its output to another future on a separate task. Read moreSource§fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
Wrap the future in a Box, pinning it. Read more
Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
Wrap the future in a Box, pinning it. Read more
Source§fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
Turns a
Future<Output = T> into a
TryFuture<Ok = T, Error = ()>.Source§fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
Turns a
Future<Output = T> into a
TryFuture<Ok = T, Error = Never>.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
fn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
Similar to
CancellationToken::run_until_cancelled,
but with the advantage that it is easier to write fluent call chains. Read moreSource§fn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
fn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
Similar to
CancellationToken::run_until_cancelled_owned,
but with the advantage that it is easier to write fluent call chains. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more