Struct zebra_network::meta_addr::MetaAddr
source · pub struct MetaAddr {
pub(crate) addr: PeerSocketAddr,
pub(crate) services: Option<PeerServices>,
untrusted_last_seen: Option<DateTime32>,
last_response: Option<DateTime32>,
last_attempt: Option<Instant>,
last_failure: Option<Instant>,
pub(crate) last_connection_state: PeerAddrState,
}
Expand description
An address with metadata on its advertised services and last-seen time.
This struct can be created from addr
or addrv2
messages.
Fields§
§addr: PeerSocketAddr
The peer’s canonical socket address.
services: Option<PeerServices>
The services advertised by the peer.
The exact meaning depends on last_connection_state
:
Responded
: the services advertised by this peer, the last time we performed a handshake with itNeverAttempted
: the unverified services advertised by another peer, then gossiped by the peer that sent us this addressFailed
orAttemptPending
: unverified services via another peer, or services advertised in a previous handshake
§Security
services
from NeverAttempted
peers may be invalid due to outdated
records, older peer versions, or buggy or malicious peers.
untrusted_last_seen: Option<DateTime32>
The unverified “last seen time” gossiped by the remote peer that sent us this address.
See the MetaAddr::last_seen
method for details.
last_response: Option<DateTime32>
The last time we received a message from this peer.
See the MetaAddr::last_seen
method for details.
last_attempt: Option<Instant>
The last time we tried to open an outbound connection to this peer.
See the MetaAddr::last_attempt
method for details.
last_failure: Option<Instant>
The last time our outbound connection with this peer failed.
See the MetaAddr::last_failure
method for details.
last_connection_state: PeerAddrState
The outcome of our most recent communication attempt with this peer.
Implementations§
source§impl MetaAddr
impl MetaAddr
sourcepub fn gossiped_strategy() -> BoxedStrategy<Self>
pub fn gossiped_strategy() -> BoxedStrategy<Self>
Create a strategy that generates MetaAddr
s in the
NeverAttemptedGossiped
state.
source§impl MetaAddr
impl MetaAddr
sourcepub fn new_initial_peer(addr: PeerSocketAddr) -> MetaAddrChange
pub fn new_initial_peer(addr: PeerSocketAddr) -> MetaAddrChange
Returns a MetaAddrChange::NewInitial
for a peer that was excluded from
the list of the initial peers.
sourcepub fn new_gossiped_meta_addr(
addr: PeerSocketAddr,
untrusted_services: PeerServices,
untrusted_last_seen: DateTime32,
) -> MetaAddr
pub fn new_gossiped_meta_addr( addr: PeerSocketAddr, untrusted_services: PeerServices, untrusted_last_seen: DateTime32, ) -> MetaAddr
Returns a new MetaAddr
, based on the deserialized fields from a
gossiped peer Addr
message.
sourcepub fn new_gossiped_change(self) -> Option<MetaAddrChange>
pub fn new_gossiped_change(self) -> Option<MetaAddrChange>
Returns a MetaAddrChange::NewGossiped
, based on a gossiped peer
MetaAddr
.
Returns None
if the gossiped peer is missing the untrusted services field.
sourcepub fn new_connected(
addr: PeerSocketAddr,
services: &PeerServices,
) -> MetaAddrChange
pub fn new_connected( addr: PeerSocketAddr, services: &PeerServices, ) -> MetaAddrChange
Returns a MetaAddrChange::UpdateConnected
for a peer that has just successfully
connected.
§Security
This address must be the remote address from an outbound connection, and the services must be the services from that peer’s handshake.
Otherwise:
- malicious peers could interfere with other peers’
AddressBook
state, or - Zebra could advertise unreachable addresses to its own peers.
sourcepub fn new_responded(addr: PeerSocketAddr) -> MetaAddrChange
pub fn new_responded(addr: PeerSocketAddr) -> MetaAddrChange
Returns a MetaAddrChange::UpdateResponded
for a peer that has just
sent us a message.
§Security
This address must be the remote address from an outbound connection.
Otherwise:
- malicious peers could interfere with other peers’
AddressBook
state, or - Zebra could advertise unreachable addresses to its own peers.
sourcepub fn new_reconnect(addr: PeerSocketAddr) -> MetaAddrChange
pub fn new_reconnect(addr: PeerSocketAddr) -> MetaAddrChange
Returns a MetaAddrChange::UpdateAttempt
for a peer that we
want to make an outbound connection to.
sourcepub fn new_local_listener_change(
addr: impl Into<PeerSocketAddr>,
) -> MetaAddrChange
pub fn new_local_listener_change( addr: impl Into<PeerSocketAddr>, ) -> MetaAddrChange
Returns a MetaAddrChange::NewLocal
for our own listener address.
sourcepub fn new_errored(
addr: PeerSocketAddr,
services: impl Into<Option<PeerServices>>,
) -> MetaAddrChange
pub fn new_errored( addr: PeerSocketAddr, services: impl Into<Option<PeerServices>>, ) -> MetaAddrChange
Returns a MetaAddrChange::UpdateFailed
for a peer that has just had an error.
sourcepub fn new_shutdown(addr: PeerSocketAddr) -> MetaAddrChange
pub fn new_shutdown(addr: PeerSocketAddr) -> MetaAddrChange
Create a new MetaAddr
for a peer that has just shut down.
sourcepub fn addr(&self) -> PeerSocketAddr
pub fn addr(&self) -> PeerSocketAddr
Return the address for this MetaAddr
.
sourcepub fn peer_preference(&self) -> Result<PeerPreference, &'static str>
pub fn peer_preference(&self) -> Result<PeerPreference, &'static str>
Return the address preference level for this MetaAddr
.
sourcepub fn last_seen(&self) -> Option<DateTime32>
pub fn last_seen(&self) -> Option<DateTime32>
Returns the time of the last successful interaction with this peer.
Initially set to the unverified “last seen time” gossiped by the remote peer that sent us this address.
If the last_connection_state
has ever been Responded
, this field is
set to the last time we processed a message from this peer.
§Security
last_seen
times from peers that have never Responded
may be
incorrect due to clock skew, or buggy or malicious peers.
sourcepub(crate) fn untrusted_last_seen(&self) -> Option<DateTime32>
pub(crate) fn untrusted_last_seen(&self) -> Option<DateTime32>
Returns the unverified “last seen time” gossiped by the remote peer that sent us this address.
See the MetaAddr::last_seen
method for details.
sourcepub(crate) fn last_response(&self) -> Option<DateTime32>
pub(crate) fn last_response(&self) -> Option<DateTime32>
Returns the last time we received a message from this peer.
See the MetaAddr::last_seen
method for details.
sourcepub(crate) fn set_untrusted_last_seen(
&mut self,
untrusted_last_seen: DateTime32,
)
pub(crate) fn set_untrusted_last_seen( &mut self, untrusted_last_seen: DateTime32, )
Set the gossiped untrusted last seen time for this peer.
sourcepub fn last_attempt(&self) -> Option<Instant>
pub fn last_attempt(&self) -> Option<Instant>
Returns the time of our last outbound connection attempt with this peer.
If the last_connection_state
has ever been AttemptPending
, this
field is set to the last time we started an outbound connection attempt
with this peer.
sourcepub fn last_failure(&self) -> Option<Instant>
pub fn last_failure(&self) -> Option<Instant>
Returns the time of our last failed outbound connection with this peer.
If the last_connection_state
has ever been Failed
, this field is set
to the last time:
- a connection attempt failed, or
- an open connection encountered a fatal protocol error.
sourcepub fn has_connection_recently_responded(&self, now: DateTime<Utc>) -> bool
pub fn has_connection_recently_responded(&self, now: DateTime<Utc>) -> bool
Have we had any recently messages from this peer?
Returns true
if the peer is likely connected and responsive in the peer
set.
constants::MIN_PEER_RECONNECTION_DELAY
represents the time interval in which
we should receive at least one message from a peer, or close the
connection. Therefore, if the last-seen timestamp is older than
constants::MIN_PEER_RECONNECTION_DELAY
ago, we know we should have
disconnected from it. Otherwise, we could potentially be connected to it.
sourcepub fn was_connection_recently_attempted(&self, now: Instant) -> bool
pub fn was_connection_recently_attempted(&self, now: Instant) -> bool
Have we recently attempted an outbound connection to this peer?
Returns true
if this peer was recently attempted, or has a connection
attempt in progress.
sourcepub fn has_connection_recently_failed(&self, now: Instant) -> bool
pub fn has_connection_recently_failed(&self, now: Instant) -> bool
Have we recently had a failed connection to this peer?
Returns true
if this peer has recently failed.
sourcepub fn was_recently_live(&self, now: DateTime<Utc>) -> bool
pub fn was_recently_live(&self, now: DateTime<Utc>) -> bool
Returns true if this peer has recently sent us a message.
sourcepub fn is_active_for_gossip(&self, now: DateTime<Utc>) -> bool
pub fn is_active_for_gossip(&self, now: DateTime<Utc>) -> bool
Has this peer been seen recently?
Returns true
if this peer has responded recently or if the peer was gossiped with a
recent reported last seen time.
constants::MAX_PEER_ACTIVE_FOR_GOSSIP
represents the maximum time since a peer was seen
to still be considered reachable.
sourcepub fn was_recently_updated(
&self,
instant_now: Instant,
chrono_now: DateTime<Utc>,
) -> bool
pub fn was_recently_updated( &self, instant_now: Instant, chrono_now: DateTime<Utc>, ) -> bool
Returns true if any messages were recently sent to or received from this address.
sourcepub fn is_ready_for_connection_attempt(
&self,
instant_now: Instant,
chrono_now: DateTime<Utc>,
network: &Network,
) -> bool
pub fn is_ready_for_connection_attempt( &self, instant_now: Instant, chrono_now: DateTime<Utc>, network: &Network, ) -> bool
Is this address ready for a new outbound connection attempt?
sourcepub fn address_is_valid_for_outbound(&self, network: &Network) -> bool
pub fn address_is_valid_for_outbound(&self, network: &Network) -> bool
Is the PeerSocketAddr
we have for this peer valid for outbound
connections?
Since the addresses in the address book are unique, this check can be
used to permanently reject entire MetaAddr
s.
sourcepub fn last_known_info_is_valid_for_outbound(&self, network: &Network) -> bool
pub fn last_known_info_is_valid_for_outbound(&self, network: &Network) -> bool
Is the last known information for this peer valid for outbound connections?
The last known info might be outdated or untrusted, so this check can only be used to:
- reject
NeverAttempted...
MetaAddrChange
s, and - temporarily stop outbound connections to a
MetaAddr
.
sourcepub fn is_probably_reachable(&self, now: DateTime<Utc>) -> bool
pub fn is_probably_reachable(&self, now: DateTime<Utc>) -> bool
Should this peer considered reachable?
A peer is probably reachable if:
- it has never been attempted, or
- the last connection attempt was successful, or
- the last successful connection was less than 3 days ago.
§Security
This is used by Self::is_ready_for_connection_attempt
so that Zebra stops trying to
connect to peers that are likely unreachable.
The untrusted_last_seen
time is used as a fallback time if the local node has never
itself seen the peer. If the reported last seen time is a long time ago or None
, then the local
node will attempt to connect the peer once, and if that attempt fails it won’t
try to connect ever again. (The state can’t be Failed
until after the first connection attempt.)
sourcepub fn last_seen_is_recent(&self, now: DateTime<Utc>) -> bool
pub fn last_seen_is_recent(&self, now: DateTime<Utc>) -> bool
Was this peer last seen recently?
Returns true
if this peer was last seen at most
MAX_RECENT_PEER_AGE
ago.
Returns false if the peer is outdated, or it has no last seen time.
Trait Implementations§
source§impl Arbitrary for MetaAddr
impl Arbitrary for MetaAddr
source§type Parameters = (<Option<PeerServices> as Arbitrary>::Parameters, <Option<DateTime32> as Arbitrary>::Parameters, <Option<DateTime32> as Arbitrary>::Parameters, <Option<Instant> as Arbitrary>::Parameters, <Option<Instant> as Arbitrary>::Parameters, <PeerAddrState as Arbitrary>::Parameters)
type Parameters = (<Option<PeerServices> as Arbitrary>::Parameters, <Option<DateTime32> as Arbitrary>::Parameters, <Option<DateTime32> as Arbitrary>::Parameters, <Option<Instant> as Arbitrary>::Parameters, <Option<Instant> as Arbitrary>::Parameters, <PeerAddrState as Arbitrary>::Parameters)
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.source§type Strategy = Map<(BoxedStrategy<PeerSocketAddr>, <Option<PeerServices> as Arbitrary>::Strategy, <Option<DateTime32> as Arbitrary>::Strategy, <Option<DateTime32> as Arbitrary>::Strategy, <Option<Instant> as Arbitrary>::Strategy, <Option<Instant> as Arbitrary>::Strategy, <PeerAddrState as Arbitrary>::Strategy), fn(_: (PeerSocketAddr, Option<PeerServices>, Option<DateTime32>, Option<DateTime32>, Option<Instant>, Option<Instant>, PeerAddrState)) -> MetaAddr>
type Strategy = Map<(BoxedStrategy<PeerSocketAddr>, <Option<PeerServices> as Arbitrary>::Strategy, <Option<DateTime32> as Arbitrary>::Strategy, <Option<DateTime32> as Arbitrary>::Strategy, <Option<Instant> as Arbitrary>::Strategy, <Option<Instant> as Arbitrary>::Strategy, <PeerAddrState as Arbitrary>::Strategy), fn(_: (PeerSocketAddr, Option<PeerServices>, Option<DateTime32>, Option<DateTime32>, Option<Instant>, Option<Instant>, PeerAddrState)) -> MetaAddr>
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 Ord for MetaAddr
impl Ord for MetaAddr
source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
MetaAddr
s are sorted in approximate reconnection attempt order, but
with Responded
peers sorted first as a group.
But this order should not be used for reconnection attempts: use
reconnection_peers
instead.
See CandidateSet
for more details.
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialOrd for MetaAddr
impl PartialOrd for MetaAddr
impl Copy for MetaAddr
impl Eq for MetaAddr
Auto Trait Implementations§
impl Freeze for MetaAddr
impl RefUnwindSafe for MetaAddr
impl Send for MetaAddr
impl Sync for MetaAddr
impl Unpin for MetaAddr
impl UnwindSafe for MetaAddr
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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<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<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.