pub enum BroadcastRequest<N: NetworkZone> {
Block {
block_bytes: Bytes,
current_blockchain_height: u64,
},
Transaction {
tx_bytes: Bytes,
direction: Option<ConnectionDirection>,
received_from: Option<InternalPeerID<N::Addr>>,
},
}Expand description
A request to broadcast some data to all connected peers or a sub-set like all inbound or all outbound.
Only certain P2P messages are supported here: [NewFluffyBlock] and [NewTransactions]. These are the only
P2P messages that make sense to broadcast to multiple peers.
NewBlock has been excluded as monerod has had fluffy blocks for a while and
Cuprate sets fluffy blocks as a requirement during handshakes.
Variants§
Block
Broadcast a block to the network. The block will be broadcast as a fluffy block to all peers.
Fields
block_bytes: BytesThe block.
Transaction
Broadcast transactions to the network. If a [ConnectionDirection] is set the transaction
will only be broadcast to that sub-set of peers, if it is None then the transaction will
be broadcast to all peers.
Trait Implementations§
Source§impl<N: NetworkZone> Service<BroadcastRequest<N>> for BroadcastSvc<N>
impl<N: NetworkZone> Service<BroadcastRequest<N>> for BroadcastSvc<N>
Source§type Error = Infallible
type Error = Infallible
Source§fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Poll::Ready(Ok(())) when the service is able to process requests. Read moreSource§fn call(&mut self, req: BroadcastRequest<N>) -> Self::Future
fn call(&mut self, req: BroadcastRequest<N>) -> Self::Future
Auto Trait Implementations§
impl<N> !Freeze for BroadcastRequest<N>
impl<N> RefUnwindSafe for BroadcastRequest<N>where
<N as NetworkZone>::Addr: RefUnwindSafe,
impl<N> Send for BroadcastRequest<N>
impl<N> Sync for BroadcastRequest<N>
impl<N> Unpin for BroadcastRequest<N>
impl<N> UnsafeUnpin for BroadcastRequest<N>where
<N as NetworkZone>::Addr: UnsafeUnpin,
impl<N> UnwindSafe for BroadcastRequest<N>where
<N as NetworkZone>::Addr: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.