[][src]Struct zebrad::components::inbound::Inbound

pub struct Inbound {
    network_setup: Option<Receiver<(Buffer<BoxService<Request, Response, BoxError>, Request>, Arc<Mutex<AddressBook>>)>>,
    outbound: Option<Buffer<BoxService<Request, Response, BoxError>, Request>>,
    address_book: Option<Arc<Mutex<AddressBook>>>,
    state: Buffer<BoxService<Request, Response, BoxError>, Request>,
}

Uses the node state to respond to inbound peer requests.

This service, wrapped in appropriate middleware, is passed to zebra_network::init to respond to inbound peer requests.

The Inbound service is responsible for:

Because the Inbound service is responsible for participating in the gossip protocols used for transaction and block diffusion, there is a potential overlap with the ChainSync component.

The division of responsibility is that the ChainSync component is internally driven, periodically polling the network to check whether it is behind the current tip, while the Inbound service is externally driven, responding to block gossip by attempting to download and validate advertised blocks.

Fields

network_setup: Option<Receiver<(Buffer<BoxService<Request, Response, BoxError>, Request>, Arc<Mutex<AddressBook>>)>>outbound: Option<Buffer<BoxService<Request, Response, BoxError>, Request>>address_book: Option<Arc<Mutex<AddressBook>>>state: Buffer<BoxService<Request, Response, BoxError>, Request>

Implementations

impl Inbound[src]

pub fn new(
    network_setup: Receiver<(Buffer<BoxService<Request, Response, BoxError>, Request>, Arc<Mutex<AddressBook>>)>,
    state: Buffer<BoxService<Request, Response, BoxError>, Request>
) -> Self
[src]

Trait Implementations

impl Service<Request> for Inbound[src]

type Response = Response

Responses given by the service.

type Error = BoxError

Errors produced by the service.

type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>

The future response value.

Auto Trait Implementations

impl !RefUnwindSafe for Inbound

impl Send for Inbound

impl !Sync for Inbound

impl Unpin for Inbound

impl !UnwindSafe for Inbound

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsAny for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Erased for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<D> OwoColorize for D

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, Request> ServiceExt<Request> for T where
    T: Service<Request> + ?Sized
[src]

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]