pub struct InventoryRegistry {Show 14 fields
current: IndexMap<InventoryHash, IndexMap<PeerSocketAddr, InventoryResponse<(), ()>>>,
prev: IndexMap<InventoryHash, IndexMap<PeerSocketAddr, InventoryResponse<(), ()>>>,
failed_current: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>,
failed_prev: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>,
refused_current: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>,
refused_prev: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>,
unanswered_current: IndexSet<InventoryHash>,
unanswered_prev: IndexSet<InventoryHash>,
served_current: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>,
served_prev: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>,
repeat_current: IndexMap<InventoryHash, RepeatRequests>,
repeat_prev: IndexMap<InventoryHash, RepeatRequests>,
inv_stream: Pin<Box<dyn Stream<Item = Result<InventoryResponse<(AtLeastOne<InventoryHash>, PeerSocketAddr), (AtLeastOne<InventoryHash>, PeerSocketAddr)>, BroadcastStreamRecvError>> + Send + 'static>>,
interval: IntervalStream,
}Expand description
An Inventory Registry for tracking recent inventory advertisements and missing inventory.
For more details please refer to the RFC.
Fields§
§current: IndexMap<InventoryHash, IndexMap<PeerSocketAddr, InventoryResponse<(), ()>>>Map tracking the latest inventory status from the current interval period.
prev: IndexMap<InventoryHash, IndexMap<PeerSocketAddr, InventoryResponse<(), ()>>>Map tracking inventory statuses from the previous interval period.
failed_current: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>Map tracking peers that failed to return inventory in the current interval period.
A failure is a completed peer error or response timeout, not caller cancellation or a
notfound response. Missing inventory is tracked separately; failed peers might still have it.
Failures are tracked separately from inventory statuses, so a peer can’t clear its failure by advertising the inventory again.
§Security
This map is limited like the status maps, using MAX_INV_PER_MAP and
MAX_PEERS_PER_INV. So it uses up to 3 MB for both intervals.
failed_prev: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>Map tracking peers that failed to return inventory in the previous interval period.
refused_current: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>Map tracking the peers that answered a request for inventory with a notfound that
lists it, in the current interval period. Routing treats these peers as missing it.
§Security
The inventory collector only keeps the first MAX_INV_PER_MAP hashes of a notfound,
and any peer can evict the oldest inventory statuses by sending that many new hashes, then
advertise the inventory again. So refusals are tracked separately, and only the peer set
records them. Otherwise, a peer that advertises a block and refuses it could get every
retry for it (GHSA-65g4-c4v4-9rfq).
This map is limited like failed_current.
refused_prev: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>Map tracking the peers that refused inventory in the previous interval period.
unanswered_current: IndexSet<InventoryHash>The blocks that some peer failed to return or refused in the current interval period, see
InventoryRegistry::is_repeat_request().
§Security
These records are kept per block, not per peer, so a peer can’t remove them by
disconnecting or reconnecting. This set is limited using MAX_INV_PER_MAP.
unanswered_prev: IndexSet<InventoryHash>The blocks that some peer failed to return or refused in the previous interval period.
served_current: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>Map tracking the peers that returned a block they were asked for because the block was advertised, in the current interval period.
§Security
A caller only asks for a block again if it rejected the block it was given. So a second
request for one of these blocks shows that a peer that advertised it served something
else, and the advertisements for it can’t be trusted. See
InventoryRegistry::served_peers().
This map is limited like failed_current.
served_prev: IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>Map tracking the peers that returned an advertised block in the previous interval period.
repeat_current: IndexMap<InventoryHash, RepeatRequests>Map tracking the repeat requests sent for a block in the current interval period, see
InventoryRegistry::repeat_requests().
This map is limited like failed_current.
repeat_prev: IndexMap<InventoryHash, RepeatRequests>Map tracking the repeat requests sent for a block in the previous interval period.
inv_stream: Pin<Box<dyn Stream<Item = Result<InventoryResponse<(AtLeastOne<InventoryHash>, PeerSocketAddr), (AtLeastOne<InventoryHash>, PeerSocketAddr)>, BroadcastStreamRecvError>> + Send + 'static>>Stream of incoming inventory statuses to register.
interval: IntervalStreamInterval tracking when we should next rotate our maps.
Implementations§
Source§impl InventoryRegistry
impl InventoryRegistry
Sourcepub fn new(
inv_stream: Receiver<InventoryResponse<(AtLeastOne<InventoryHash>, PeerSocketAddr), (AtLeastOne<InventoryHash>, PeerSocketAddr)>>,
) -> Self
pub fn new( inv_stream: Receiver<InventoryResponse<(AtLeastOne<InventoryHash>, PeerSocketAddr), (AtLeastOne<InventoryHash>, PeerSocketAddr)>>, ) -> Self
Returns a new Inventory Registry for inv_stream.
Sourcepub fn advertising_peers(
&self,
hash: InventoryHash,
) -> impl Iterator<Item = &PeerSocketAddr>
pub fn advertising_peers( &self, hash: InventoryHash, ) -> impl Iterator<Item = &PeerSocketAddr>
Returns an iterator over addrs of peers that have recently advertised hash in their
inventory, and haven’t refused it since.
Sourcepub fn missing_peers(
&self,
hash: InventoryHash,
) -> impl Iterator<Item = &PeerSocketAddr>
pub fn missing_peers( &self, hash: InventoryHash, ) -> impl Iterator<Item = &PeerSocketAddr>
Returns an iterator over addrs of peers that have recently missed hash in their
inventory, or refused it.
Can include the same peer twice, if it refused hash in the current and previous interval.
Sourcepub fn register_refused(&mut self, hash: InventoryHash, peer: PeerSocketAddr)
pub fn register_refused(&mut self, hash: InventoryHash, peer: PeerSocketAddr)
Records that peer answered a request for hash with a notfound that lists it.
These records expire after the registry rotates twice, like inventory statuses. Unlike failures, they are about the peer’s address, not its connection.
Sourcefn has_refused(&self, hash: InventoryHash, peer: &PeerSocketAddr) -> bool
fn has_refused(&self, hash: InventoryHash, peer: &PeerSocketAddr) -> bool
Returns true if peer recently refused hash.
Sourcepub fn failed_peers(
&self,
hash: InventoryHash,
) -> impl Iterator<Item = &PeerSocketAddr>
pub fn failed_peers( &self, hash: InventoryHash, ) -> impl Iterator<Item = &PeerSocketAddr>
Returns an iterator over addrs of peers that recently failed to return hash.
Can include the same peer twice, if it failed in the current and previous interval.
Sourcepub fn register_failed(&mut self, hash: InventoryHash, peer: PeerSocketAddr)
pub fn register_failed(&mut self, hash: InventoryHash, peer: PeerSocketAddr)
Records that peer failed to return hash.
Failures expire after the registry rotates twice, like inventory statuses.
Sourcepub fn register_unanswered(&mut self, hash: InventoryHash)
pub fn register_unanswered(&mut self, hash: InventoryHash)
Records that a peer failed to return hash or answered notfound for it, whether or not
that peer is still connected.
These records expire after the registry rotates twice, like inventory statuses.
Sourcepub fn is_repeat_request(&self, hash: InventoryHash) -> bool
pub fn is_repeat_request(&self, hash: InventoryHash) -> bool
Returns true if a request for hash is a repeat: a peer recently failed to return
hash, refused it, or returned it after it was chosen for an advertisement or in a repeat request.
§Security
The advertisements for a block can’t be trusted once a request for it didn’t deliver a
block the caller accepted. A peer can advertise a block and serve its header with other
transactions (GHSA-g9rc-89v4-hhvf), or advertise it from many addresses and never answer
or answer notfound (GHSA-g9wm-xjq3-x3c2). Advertising is free, so in both cases the peers that advertised
the block must not get every request for it. See InventoryRegistry::repeat_requests().
Sourcepub fn served_peers(
&self,
hash: InventoryHash,
) -> impl Iterator<Item = &PeerSocketAddr>
pub fn served_peers( &self, hash: InventoryHash, ) -> impl Iterator<Item = &PeerSocketAddr>
Returns an iterator over addrs of peers that recently returned hash when they were asked
for it because it was advertised, or in a repeat request.
Can include the same peer twice, if it returned hash in the current and previous interval.
§Security
If this isn’t empty, a request for hash is a repeat: the caller rejected the block one
of these peers gave it. A block hash only commits to the header, so a peer can advertise a
block and then serve its header with other transactions. So the caller should only ask
these peers as a last resort.
Several peers can advertise the same block to get each retry in turn, and the caller can’t
tell them from the honest peers that advertised it. See
[InventoryRegistry::repeat_answer_count()].
Sourcepub fn register_served(&mut self, hash: InventoryHash, peer: PeerSocketAddr)
pub fn register_served(&mut self, hash: InventoryHash, peer: PeerSocketAddr)
Records that peer returned hash when it was asked for it because it was advertised, or
in a repeat request.
These records expire after the registry rotates twice, like inventory statuses.
Sourcepub fn repeat_requests(&self, hash: InventoryHash) -> RepeatRequests
pub fn repeat_requests(&self, hash: InventoryHash) -> RepeatRequests
Returns how many repeat requests for hash were recently sent to the peers that
advertised it, and to the peers that didn’t.
§Security
The peers that advertised hash and the peers that didn’t take turns to get the repeat
requests for it, and these counts decide whose turn it is. A peer that forges blocks can
advertise them from several addresses, and it can also connect from addresses that don’t
advertise them and don’t answer. So if either group got every repeat request, that group
could keep them all from the honest peers.
Requests are counted when they are sent, not when they are answered. So several repeat requests in flight at the same time take turns too, and a peer can’t change the turn by delaying its answer.
Sourcepub fn register_repeat_request(&mut self, hash: InventoryHash, advertised: bool)
pub fn register_repeat_request(&mut self, hash: InventoryHash, advertised: bool)
Records that a repeat request for hash was sent to a peer that advertised it, if
advertised is true, or to a peer that didn’t.
These records expire after the registry rotates twice, like inventory statuses.
Sourcefn register_peer(
map: &mut IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>,
hash: InventoryHash,
peer: PeerSocketAddr,
)
fn register_peer( map: &mut IndexMap<InventoryHash, IndexSet<PeerSocketAddr>>, hash: InventoryHash, peer: PeerSocketAddr, )
Adds peer to the peers for hash in map, as the newest entry.
Sourcepub fn clear_peer_failures(&mut self, peer: PeerSocketAddr)
pub fn clear_peer_failures(&mut self, peer: PeerSocketAddr)
Clears failures from previous connections that used peer’s transient address.
Sourcepub fn status_peers(
&self,
hash: InventoryHash,
) -> impl Iterator<Item = InventoryResponse<&PeerSocketAddr, &PeerSocketAddr>>
pub fn status_peers( &self, hash: InventoryHash, ) -> impl Iterator<Item = InventoryResponse<&PeerSocketAddr, &PeerSocketAddr>>
Returns an iterator over peer inventory statuses for hash.
Prefers current statuses to previously rotated statuses for the same peer.
Sourcepub fn has_current_status(
&self,
hash: InventoryHash,
addr: PeerSocketAddr,
) -> bool
pub fn has_current_status( &self, hash: InventoryHash, addr: PeerSocketAddr, ) -> bool
Returns true if there is a current status entry for hash and addr.
Sourcepub fn status_hashes(
&self,
) -> impl Iterator<Item = (&InventoryHash, &IndexMap<PeerSocketAddr, InventoryResponse<(), ()>>)>
pub fn status_hashes( &self, ) -> impl Iterator<Item = (&InventoryHash, &IndexMap<PeerSocketAddr, InventoryResponse<(), ()>>)>
Returns an iterator over peer inventory status hashes.
Yields current statuses first, then previously rotated statuses. This can include multiple statuses for the same hash.
Sourcepub fn poll_inventory(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), BoxError>>
pub fn poll_inventory( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), BoxError>>
Drive periodic inventory tasks.
Rotates the inventory HashMaps on every timer tick. Drains the inv_stream channel and registers all advertised inventory.
Returns an error if the inventory channel is closed.
Otherwise, returns Ok if it performed at least one update or rotation, or Poll::Pending
if there was no inventory change. Always registers a wakeup for the next inventory update
or rotation, even when it returns Ok.
Sourcefn register(
&mut self,
change: InventoryResponse<(AtLeastOne<InventoryHash>, PeerSocketAddr), (AtLeastOne<InventoryHash>, PeerSocketAddr)>,
)
fn register( &mut self, change: InventoryResponse<(AtLeastOne<InventoryHash>, PeerSocketAddr), (AtLeastOne<InventoryHash>, PeerSocketAddr)>, )
Record the given inventory change for the peer addr.
Missing markers are not updated until the registry rotates, for security reasons.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for InventoryRegistry
impl !Sync for InventoryRegistry
impl !UnwindSafe for InventoryRegistry
impl Freeze for InventoryRegistry
impl Send for InventoryRegistry
impl Unpin for InventoryRegistry
impl UnsafeUnpin for InventoryRegistry
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<T> Conv for T
impl<T> Conv for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§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,
§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> 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> 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 moreimpl<T> MaybeSendSync for T
§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_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, 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) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() 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)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
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)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§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> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§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>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
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: 912 bytes