pub enum Request {
Peers,
BlocksByHash(HashSet<Hash>),
TransactionsById(HashSet<UnminedTxId>),
FindBlocks {
known_blocks: Vec<Hash>,
stop: Option<Hash>,
},
FindHeaders {
known_blocks: Vec<Hash>,
stop: Option<Hash>,
},
PushTransaction(UnminedTx),
AdvertiseTransactionIds(HashSet<UnminedTxId>),
AdvertiseBlock(Hash),
MempoolTransactionIds,
// some variants omitted
}
Expand description
A network request, represented in internal format.
The network layer aims to abstract away the details of the Bitcoin wire
protocol into a clear request/response API. Each Request
documents the
possible Response
s it can generate; it is fine (and
recommended!) to match on the expected responses and treat the others as
unreachable!()
, since their return indicates a bug in the network code.
Cancellations
The peer set handles cancelled requests (i.e., requests where the future
returned by Service::call
is dropped before it resolves) on a best-effort
basis. Requests are routed to a particular peer connection, and then
translated into Zcash protocol messages and sent over the network. If a
request is cancelled after it is submitted but before it is processed by a
peer connection, no messages will be sent. Otherwise, if it is cancelled
while waiting for a response, the peer connection resets its state and makes
a best-effort attempt to ignore any messages responsive to the cancelled
request, subject to limitations in the underlying Zcash protocol.
Variants§
Peers
BlocksByHash(HashSet<Hash>)
Request block data by block hashes.
This uses a HashSet
rather than a Vec
for two reasons. First, it
automatically deduplicates the requested blocks. Second, the internal
protocol translator needs to maintain a HashSet
anyways, in order to
keep track of which requested blocks have been received and when the
request is ready. Rather than force the internals to always convert into
a HashSet
, we require the caller to pass one, so that if the caller
didn’t start with a Vec
but with, e.g., an iterator, they can collect
directly into a HashSet
and save work.
If this requests a recently-advertised block, the peer set will make a best-effort attempt to route the request to a peer that advertised the block. This routing is only used for request sets of size 1. Otherwise, it is routed using the normal load-balancing strategy.
The list contains zero or more block hashes.
Returns
Returns Response::Blocks
.
TransactionsById(HashSet<UnminedTxId>)
Request transactions by their unmined transaction ID.
v4 transactions use a legacy transaction ID, and v5 transactions use a witnessed transaction ID.
This uses a HashSet
for the same reason as Request::BlocksByHash
.
If this requests a recently-advertised transaction, the peer set will make a best-effort attempt to route the request to a peer that advertised the transaction. This routing is only used for request sets of size 1. Otherwise, it is routed using the normal load-balancing strategy.
The list contains zero or more unmined transaction IDs.
Returns
Returns Response::Transactions
.
FindBlocks
Fields
Request block hashes of subsequent blocks in the chain, given hashes of known blocks.
The known blocks list contains zero or more block hashes.
Returns
Returns
Response::BlockHashes
.
Warning
This is implemented by sending a getblocks
message. Bitcoin nodes
respond to getblocks
with an inv
message containing a list of the
subsequent blocks. However, Bitcoin nodes also send inv
messages
unsolicited in order to gossip new blocks to their peers. These gossip
messages can race with the response to a getblocks
request, and there
is no way for the network layer to distinguish them. For this reason, the
response may occasionally contain a single hash of a new chain tip rather
than a list of hashes of subsequent blocks. We believe that unsolicited
inv
messages will always have exactly one block hash.
FindHeaders
Fields
Request headers of subsequent blocks in the chain, given hashes of known blocks.
The known blocks list contains zero or more block hashes.
Returns
Returns
Response::BlockHeaders
.
PushTransaction(UnminedTx)
Push an unmined transaction to a remote peer, without advertising it to them first.
This is implemented by sending an unsolicited tx
message.
Returns
Returns Response::Nil
.
AdvertiseTransactionIds(HashSet<UnminedTxId>)
Advertise a set of unmined transactions to all peers.
This is intended to be used in Zebra with a single transaction at a time (set of size 1), but multiple transactions are permitted because this is how we interpret advertisements from zcashd, which sometimes advertises multiple transactions at once.
This is implemented by sending an inv
message containing the unmined
transaction ID, allowing the remote peer to choose whether to download
it. Remote peers who choose to download the transaction will generate a
Request::TransactionsById
against the “inbound” service passed to
init
.
v4 transactions use a legacy transaction ID, and v5 transactions use a witnessed transaction ID.
The list contains zero or more transaction IDs.
The peer set routes this request specially, sending it to half of the available peers.
Returns
Returns Response::Nil
.
AdvertiseBlock(Hash)
Advertise a block to all peers.
This is implemented by sending an inv
message containing the
block hash, allowing the remote peer to choose whether to download
it. Remote peers who choose to download the block will generate a
Request::BlocksByHash
against the “inbound” service passed to
init
.
The peer set routes this request specially, sending it to half of the available peers.
Returns
Returns Response::Nil
.
MempoolTransactionIds
Implementations§
source§impl Request
impl Request
sourcepub fn is_inventory_download(&self) -> bool
pub fn is_inventory_download(&self) -> bool
Returns true if the request is for block or transaction inventory downloads.
sourcepub fn block_hash_inventory(&self) -> HashSet<Hash>
pub fn block_hash_inventory(&self) -> HashSet<Hash>
Returns the block hash inventory downloads from the request, if any.
sourcepub fn transaction_id_inventory(&self) -> HashSet<UnminedTxId>
pub fn transaction_id_inventory(&self) -> HashSet<UnminedTxId>
Returns the transaction ID inventory downloads from the request, if any.
Trait Implementations§
source§impl Arbitrary for Request
impl Arbitrary for Request
§type Parameters = (<Nonce as Arbitrary>::Parameters, <HashSet<Hash, RandomState> as Arbitrary>::Parameters, <HashSet<UnminedTxId, RandomState> as Arbitrary>::Parameters, (<Vec<Hash, Global> as Arbitrary>::Parameters, <Option<Hash> as Arbitrary>::Parameters), (<Vec<Hash, Global> as Arbitrary>::Parameters, <Option<Hash> as Arbitrary>::Parameters), <UnminedTx as Arbitrary>::Parameters, <HashSet<UnminedTxId, RandomState> as Arbitrary>::Parameters, <Hash as Arbitrary>::Parameters)
type Parameters = (<Nonce as Arbitrary>::Parameters, <HashSet<Hash, RandomState> as Arbitrary>::Parameters, <HashSet<UnminedTxId, RandomState> as Arbitrary>::Parameters, (<Vec<Hash, Global> as Arbitrary>::Parameters, <Option<Hash> as Arbitrary>::Parameters), (<Vec<Hash, Global> as Arbitrary>::Parameters, <Option<Hash> as Arbitrary>::Parameters), <UnminedTx as Arbitrary>::Parameters, <HashSet<UnminedTxId, RandomState> as Arbitrary>::Parameters, <Hash as Arbitrary>::Parameters)
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = TupleUnion<((u32, Arc<fn() -> Request>), (u32, Arc<Map<<Nonce as Arbitrary>::Strategy, fn(_: Nonce) -> Request>>), (u32, Arc<Map<<HashSet<Hash, RandomState> as Arbitrary>::Strategy, fn(_: HashSet<Hash, RandomState>) -> Request>>), (u32, Arc<Map<<HashSet<UnminedTxId, RandomState> as Arbitrary>::Strategy, fn(_: HashSet<UnminedTxId, RandomState>) -> Request>>), (u32, Arc<Map<(<Vec<Hash, Global> as Arbitrary>::Strategy, <Option<Hash> as Arbitrary>::Strategy), fn(_: (Vec<Hash, Global>, Option<Hash>)) -> Request>>), (u32, Arc<Map<(<Vec<Hash, Global> as Arbitrary>::Strategy, <Option<Hash> as Arbitrary>::Strategy), fn(_: (Vec<Hash, Global>, Option<Hash>)) -> Request>>), (u32, Arc<Map<<UnminedTx as Arbitrary>::Strategy, fn(_: UnminedTx) -> Request>>), (u32, Arc<Map<<HashSet<UnminedTxId, RandomState> as Arbitrary>::Strategy, fn(_: HashSet<UnminedTxId, RandomState>) -> Request>>), (u32, Arc<Map<<Hash as Arbitrary>::Strategy, fn(_: Hash) -> Request>>), (u32, Arc<fn() -> Request>))>
type Strategy = TupleUnion<((u32, Arc<fn() -> Request>), (u32, Arc<Map<<Nonce as Arbitrary>::Strategy, fn(_: Nonce) -> Request>>), (u32, Arc<Map<<HashSet<Hash, RandomState> as Arbitrary>::Strategy, fn(_: HashSet<Hash, RandomState>) -> Request>>), (u32, Arc<Map<<HashSet<UnminedTxId, RandomState> as Arbitrary>::Strategy, fn(_: HashSet<UnminedTxId, RandomState>) -> Request>>), (u32, Arc<Map<(<Vec<Hash, Global> as Arbitrary>::Strategy, <Option<Hash> as Arbitrary>::Strategy), fn(_: (Vec<Hash, Global>, Option<Hash>)) -> Request>>), (u32, Arc<Map<(<Vec<Hash, Global> as Arbitrary>::Strategy, <Option<Hash> as Arbitrary>::Strategy), fn(_: (Vec<Hash, Global>, Option<Hash>)) -> Request>>), (u32, Arc<Map<<UnminedTx as Arbitrary>::Strategy, fn(_: UnminedTx) -> Request>>), (u32, Arc<Map<<HashSet<UnminedTxId, RandomState> as Arbitrary>::Strategy, fn(_: HashSet<UnminedTxId, RandomState>) -> Request>>), (u32, Arc<Map<<Hash as Arbitrary>::Strategy, fn(_: Hash) -> Request>>), (u32, Arc<fn() -> Request>))>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl From<Request> for InboundMessage
impl From<Request> for InboundMessage
source§impl PartialEq<Request> for Request
impl PartialEq<Request> for Request
source§impl Service<Request> for Client
impl Service<Request> for Client
§type Error = SharedPeerError
type Error = SharedPeerError
§type Future = Pin<Box<dyn Future<Output = Result<<Client as Service<Request>>::Response, <Client as Service<Request>>::Error>> + Send + 'static, Global>>
type Future = Pin<Box<dyn Future<Output = Result<<Client as Service<Request>>::Response, <Client as Service<Request>>::Error>> + Send + 'static, Global>>
source§impl<D, C> Service<Request> for PeerSet<D, C>where
D: Discover<Key = SocketAddr, Service = LoadTrackedClient> + Unpin,
D::Error: Into<BoxError>,
C: ChainTip,
impl<D, C> Service<Request> for PeerSet<D, C>where D: Discover<Key = SocketAddr, Service = LoadTrackedClient> + Unpin, D::Error: Into<BoxError>, C: ChainTip,
§type Future = Pin<Box<dyn Future<Output = Result<<PeerSet<D, C> as Service<Request>>::Response, <PeerSet<D, C> as Service<Request>>::Error>> + Send + 'static, Global>>
type Future = Pin<Box<dyn Future<Output = Result<<PeerSet<D, C> as Service<Request>>::Response, <PeerSet<D, C> as Service<Request>>::Error>> + Send + 'static, Global>>
impl Eq for Request
impl StructuralEq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
Blanket Implementations§
§impl<T> Conv for T
impl<T> Conv for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,
source§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> 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>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_mut()
into the pipe
function.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Response, Error> ResponseResult<Response, Error> for Response
impl<Response, Error> ResponseResult<Response, Error> for Response
source§fn into_result(self) -> Result<Response, Error>
fn into_result(self) -> Result<Response, Error>
Result
that can be sent as a response.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.