type ConcreteDandelionRouter = DandelionRouter<OutboundPeerStream, DiffuseService, CrossNetworkInternalPeerId, StemPeerService<ClearNet>, DandelionTx>;
Expand description
A DandelionRouter
with all generic types defined.
Aliased Type§
struct ConcreteDandelionRouter { /* private fields */ }
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 288 bytes
Implementations
Source§impl<Tx, Id, P, B, S> DandelionRouter<P, B, Id, S, Tx>where
Id: Hash + Eq + Clone,
P: TryStream<Ok = OutboundPeer<Id, S>, Error = Box<dyn Error + Send + Sync>>,
B: Service<DiffuseRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<B as Service<DiffuseRequest<Tx>>>::Future: Send + 'static,
S: Service<StemRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<S as Service<StemRequest<Tx>>>::Future: Send + 'static,
impl<Tx, Id, P, B, S> DandelionRouter<P, B, Id, S, Tx>where
Id: Hash + Eq + Clone,
P: TryStream<Ok = OutboundPeer<Id, S>, Error = Box<dyn Error + Send + Sync>>,
B: Service<DiffuseRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<B as Service<DiffuseRequest<Tx>>>::Future: Send + 'static,
S: Service<StemRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<S as Service<StemRequest<Tx>>>::Future: Send + 'static,
Sourcepub fn new(
broadcast_svc: B,
outbound_peer_discover: P,
config: DandelionConfig,
) -> DandelionRouter<P, B, Id, S, Tx>
pub fn new( broadcast_svc: B, outbound_peer_discover: P, config: DandelionConfig, ) -> DandelionRouter<P, B, Id, S, Tx>
Creates a new DandelionRouter
, with the provided services and config.
§Panics
This function panics if DandelionConfig::fluff_probability
is not 0.0..=1.0
.
Trait Implementations
Source§impl<Tx, Id, P, B, S> Service<DandelionRouteReq<Tx, Id>> for DandelionRouter<P, B, Id, S, Tx>where
Id: Hash + Eq + Clone,
P: TryStream<Ok = OutboundPeer<Id, S>, Error = Box<dyn Error + Send + Sync>>,
B: Service<DiffuseRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<B as Service<DiffuseRequest<Tx>>>::Future: Send + 'static,
S: Service<StemRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<S as Service<StemRequest<Tx>>>::Future: Send + 'static,
impl<Tx, Id, P, B, S> Service<DandelionRouteReq<Tx, Id>> for DandelionRouter<P, B, Id, S, Tx>where
Id: Hash + Eq + Clone,
P: TryStream<Ok = OutboundPeer<Id, S>, Error = Box<dyn Error + Send + Sync>>,
B: Service<DiffuseRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<B as Service<DiffuseRequest<Tx>>>::Future: Send + 'static,
S: Service<StemRequest<Tx>, Error = Box<dyn Error + Send + Sync>>,
<S as Service<StemRequest<Tx>>>::Future: Send + 'static,
Source§type Error = DandelionRouterError
type Error = DandelionRouterError
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<State, DandelionRouterError>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<State, DandelionRouterError>> + Send>>
The future response value.
Source§fn poll_ready(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), <DandelionRouter<P, B, Id, S, Tx> as Service<DandelionRouteReq<Tx, Id>>>::Error>>
fn poll_ready( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), <DandelionRouter<P, B, Id, S, Tx> as Service<DandelionRouteReq<Tx, Id>>>::Error>>
Returns
Poll::Ready(Ok(()))
when the service is able to process requests. Read moreSource§fn call(
&mut self,
req: DandelionRouteReq<Tx, Id>,
) -> <DandelionRouter<P, B, Id, S, Tx> as Service<DandelionRouteReq<Tx, Id>>>::Future
fn call( &mut self, req: DandelionRouteReq<Tx, Id>, ) -> <DandelionRouter<P, B, Id, S, Tx> as Service<DandelionRouteReq<Tx, Id>>>::Future
Process the request and return the response asynchronously. Read more