Struct network_clique::service::Service
source · pub struct Service<SK: SecretKey, D: Data, A: Data, ND: Dialer<A>, NL: Listener, SH: SpawnHandleT>{
commands_from_interface: UnboundedReceiver<ServiceCommand<SK::PublicKey, D, A>>,
next_to_interface: UnboundedSender<D>,
manager: Manager<SK::PublicKey, A, D>,
dialer: ND,
listener: NL,
spawn_handle: SH,
secret_key: SK,
metrics: Metrics,
}
Expand description
A service that has to be run for the clique network to work.
Fields§
§commands_from_interface: UnboundedReceiver<ServiceCommand<SK::PublicKey, D, A>>
§next_to_interface: UnboundedSender<D>
§manager: Manager<SK::PublicKey, A, D>
§dialer: ND
§listener: NL
§spawn_handle: SH
§secret_key: SK
§metrics: Metrics
Implementations§
source§impl<SK: SecretKey, D: Data, A: Data + Debug, ND: Dialer<A>, NL: Listener, SH: SpawnHandleT> Service<SK, D, A, ND, NL, SH>
impl<SK: SecretKey, D: Data, A: Data + Debug, ND: Dialer<A>, NL: Listener, SH: SpawnHandleT> Service<SK, D, A, ND, NL, SH>
sourcepub fn new(
dialer: ND,
listener: NL,
secret_key: SK,
spawn_handle: SH,
metrics_registry: Option<Registry>
) -> (Self, impl Network<SK::PublicKey, A, D>)
pub fn new( dialer: ND, listener: NL, secret_key: SK, spawn_handle: SH, metrics_registry: Option<Registry> ) -> (Self, impl Network<SK::PublicKey, A, D>)
Create a new clique network service plus an interface for interacting with it.
fn spawn_new_outgoing( &mut self, public_key: SK::PublicKey, address: A, result_for_parent: UnboundedSender<(SK::PublicKey, Option<UnboundedSender<D>>)> )
fn spawn_new_incoming( &self, stream: NL::Connection, result_for_parent: UnboundedSender<(SK::PublicKey, Option<UnboundedSender<D>>)>, authorization_requests_sender: UnboundedSender<(SK::PublicKey, Sender<bool>)> )
fn peer_address(&self, public_key: &SK::PublicKey) -> Option<A>
fn add_connection( &mut self, public_key: SK::PublicKey, data_for_network: UnboundedSender<D> ) -> AddResult
Auto Trait Implementations§
impl<SK, D, A, ND, NL, SH> !RefUnwindSafe for Service<SK, D, A, ND, NL, SH>
impl<SK, D, A, ND, NL, SH> Send for Service<SK, D, A, ND, NL, SH>
impl<SK, D, A, ND, NL, SH> Sync for Service<SK, D, A, ND, NL, SH>
impl<SK, D, A, ND, NL, SH> Unpin for Service<SK, D, A, ND, NL, SH>
impl<SK, D, A, ND, NL, SH> !UnwindSafe for Service<SK, D, A, ND, NL, SH>
Blanket Implementations§
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