pub struct Network { /* private fields */ }
Expand description
API to interact with the underlying Swarm
Implementations§
Source§impl Network
impl Network
pub fn new( network_swarm_cmd_sender: Sender<NetworkSwarmCmd>, local_swarm_cmd_sender: Sender<LocalSwarmCmd>, peer_id: PeerId, keypair: Keypair, ) -> Self
Sourcepub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, NetworkError>
pub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, NetworkError>
Signs the given data with the node’s keypair.
Sourcepub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
Verifies a signature for the given data and the node’s public key.
Sourcepub fn get_pub_key(&self) -> Vec<u8> ⓘ
pub fn get_pub_key(&self) -> Vec<u8> ⓘ
Returns the protobuf serialised PublicKey to allow messaging out for share.
Sourcepub async fn get_local_peers_with_multiaddr(
&self,
) -> Result<Vec<(PeerId, Vec<Multiaddr>)>, NetworkError>
pub async fn get_local_peers_with_multiaddr( &self, ) -> Result<Vec<(PeerId, Vec<Multiaddr>)>, NetworkError>
Returns a list of peers in local RT and their correspondent Multiaddr. Does not include self
Sourcepub async fn get_kbuckets(
&self,
) -> Result<BTreeMap<u32, Vec<PeerId>>, NetworkError>
pub async fn get_kbuckets( &self, ) -> Result<BTreeMap<u32, Vec<PeerId>>, NetworkError>
Returns a map where each key is the ilog2 distance of that Kbucket and each value is a vector of peers in that bucket. Does not include self
Sourcepub async fn get_closest_k_value_local_peers(
&self,
) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
pub async fn get_closest_k_value_local_peers( &self, ) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
Returns all the PeerId from all the KBuckets from our local Routing Table Also contains our own PeerId.
Sourcepub async fn get_close_peers_to_the_target(
&self,
key: NetworkAddress,
num_of_peers: usize,
) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
pub async fn get_close_peers_to_the_target( &self, key: NetworkAddress, num_of_peers: usize, ) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
Returns X close peers to the target. Note: self is not included
Sourcepub async fn verify_chunk_existence(
&self,
chunk_address: NetworkAddress,
close_nodes: Vec<(PeerId, Addresses)>,
nonce: Nonce,
expected_proof: ChunkProof,
quorum: ResponseQuorum,
_retry_strategy: RetryStrategy,
) -> Result<(), NetworkError>
pub async fn verify_chunk_existence( &self, chunk_address: NetworkAddress, close_nodes: Vec<(PeerId, Addresses)>, nonce: Nonce, expected_proof: ChunkProof, quorum: ResponseQuorum, _retry_strategy: RetryStrategy, ) -> Result<(), NetworkError>
Get the Chunk existence proof from the close nodes to the provided chunk address. This is to be used by client only to verify the success of the upload.
Sourcepub async fn get_store_quote_from_network(
&self,
record_address: NetworkAddress,
data_type: u32,
data_size: usize,
ignore_peers: Vec<PeerId>,
) -> Result<Vec<(PeerId, Addresses, PaymentQuote)>, NetworkError>
pub async fn get_store_quote_from_network( &self, record_address: NetworkAddress, data_type: u32, data_size: usize, ignore_peers: Vec<PeerId>, ) -> Result<Vec<(PeerId, Addresses, PaymentQuote)>, NetworkError>
Get the store costs from the majority of the closest peers to the provided RecordKey. Record already exists will have a cost of zero to be returned.
Ignore the quote from any peers from ignore_peers
.
This is useful if we want to repay a different PeerId on failure.
Sourcepub async fn get_record_from_network(
&self,
key: RecordKey,
cfg: &GetRecordCfg,
) -> Result<Record, NetworkError>
pub async fn get_record_from_network( &self, key: RecordKey, cfg: &GetRecordCfg, ) -> Result<Record, NetworkError>
Get the Record from the network Carry out re-attempts if required In case a target_record is provided, only return when fetched target. Otherwise count it as a failure when all attempts completed.
It also handles the split record error for GraphEntry.
Sourcepub async fn get_local_quoting_metrics(
&self,
key: RecordKey,
data_type: u32,
data_size: usize,
) -> Result<(QuotingMetrics, bool), NetworkError>
pub async fn get_local_quoting_metrics( &self, key: RecordKey, data_type: u32, data_size: usize, ) -> Result<(QuotingMetrics, bool), NetworkError>
Get the quoting metrics for storing the next record from the network
Sourcepub fn notify_payment_received(&self)
pub fn notify_payment_received(&self)
Notify the node receicced a payment.
Sourcepub async fn get_local_record(
&self,
key: &RecordKey,
) -> Result<Option<Record>, NetworkError>
pub async fn get_local_record( &self, key: &RecordKey, ) -> Result<Option<Record>, NetworkError>
Get Record
from the local RecordStore
Sourcepub async fn is_peer_shunned(
&self,
target: NetworkAddress,
) -> Result<bool, NetworkError>
pub async fn is_peer_shunned( &self, target: NetworkAddress, ) -> Result<bool, NetworkError>
Whether the target peer is considered blacklisted by self
Sourcepub async fn put_record(
&self,
record: Record,
cfg: &PutRecordCfg,
) -> Result<(), NetworkError>
pub async fn put_record( &self, record: Record, cfg: &PutRecordCfg, ) -> Result<(), NetworkError>
Put Record
to network
Optionally verify the record is stored after putting it to network
If verify is on, we retry.
Sourcepub fn notify_fetch_completed(
&self,
key: RecordKey,
record_type: ValidationType,
)
pub fn notify_fetch_completed( &self, key: RecordKey, record_type: ValidationType, )
Notify ReplicationFetch a fetch attempt is completed. (but it won’t trigger any real writes to disk)
Sourcepub fn put_local_record(&self, record: Record, is_client_put: bool)
pub fn put_local_record(&self, record: Record, is_client_put: bool)
Put Record
to the local RecordStore
Must be called after the validations are performed on the Record
Sourcepub async fn is_record_key_present_locally(
&self,
key: &RecordKey,
) -> Result<bool, NetworkError>
pub async fn is_record_key_present_locally( &self, key: &RecordKey, ) -> Result<bool, NetworkError>
Returns true if a RecordKey is present locally in the RecordStore
Sourcepub async fn get_all_local_record_addresses(
&self,
) -> Result<HashMap<NetworkAddress, ValidationType>, NetworkError>
pub async fn get_all_local_record_addresses( &self, ) -> Result<HashMap<NetworkAddress, ValidationType>, NetworkError>
Returns the Addresses of all the locally stored Records
Sourcepub async fn send_request(
&self,
req: Request,
peer: PeerId,
addrs: Addresses,
) -> Result<(Response, Option<ConnectionInfo>), NetworkError>
pub async fn send_request( &self, req: Request, peer: PeerId, addrs: Addresses, ) -> Result<(Response, Option<ConnectionInfo>), NetworkError>
Send Request
to the given PeerId
and await for the response. If self
is the recipient,
then the Request
is forwarded to itself and handled, and a corresponding Response
is created
and returned to itself. Hence the flow remains the same and there is no branching at the upper
layers.
If an outbound issue is raised, we retry once more to send the request before returning an error.
Sourcepub fn send_response(&self, resp: Response, channel: MsgResponder)
pub fn send_response(&self, resp: Response, channel: MsgResponder)
Send a Response
through the channel opened by the requester.
Sourcepub async fn get_swarm_local_state(
&self,
) -> Result<SwarmLocalState, NetworkError>
pub async fn get_swarm_local_state( &self, ) -> Result<SwarmLocalState, NetworkError>
Return a SwarmLocalState
with some information obtained from swarm’s local state.
pub fn trigger_interval_replication(&self)
pub fn add_fresh_records_to_the_replication_fetcher( &self, holder: NetworkAddress, keys: Vec<(NetworkAddress, ValidationType)>, )
pub fn record_node_issues(&self, peer_id: PeerId, issue: NodeIssue)
pub fn historical_verify_quotes(&self, quotes: Vec<(PeerId, PaymentQuote)>)
pub fn trigger_irrelevant_record_cleanup(&self)
pub fn add_network_density_sample(&self, distance: KBucketDistance)
pub fn notify_peer_scores(&self, peer_scores: Vec<(PeerId, bool)>)
pub fn notify_node_version(&self, peer: PeerId, version: String)
pub fn remove_peer(&self, peer: PeerId)
Sourcepub async fn get_closest_peers(
&self,
key: &NetworkAddress,
) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
pub async fn get_closest_peers( &self, key: &NetworkAddress, ) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
Returns the closest peers to the given XorName
, sorted by their distance to the xor_name.
Sourcepub async fn get_n_closest_peers(
&self,
key: &NetworkAddress,
n: usize,
) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
pub async fn get_n_closest_peers( &self, key: &NetworkAddress, n: usize, ) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
Returns the n
closest peers to the given XorName
, sorted by their distance to the xor_name.
Sourcepub async fn client_get_close_group(
&self,
key: &NetworkAddress,
) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
pub async fn client_get_close_group( &self, key: &NetworkAddress, ) -> Result<Vec<(PeerId, Addresses)>, NetworkError>
Returns the closest peers to the given XorName
, sorted by their distance to the xor_name.
Excludes the client’s PeerId
while calculating the closest peers.
Sourcepub async fn send_and_get_responses(
&self,
peers: &[(PeerId, Addresses)],
req: &Request,
get_all_responses: bool,
) -> BTreeMap<PeerId, Result<(Response, Option<ConnectionInfo>), NetworkError>>
pub async fn send_and_get_responses( &self, peers: &[(PeerId, Addresses)], req: &Request, get_all_responses: bool, ) -> BTreeMap<PeerId, Result<(Response, Option<ConnectionInfo>), NetworkError>>
Send a Request
to the provided set of peers and wait for their responses concurrently.
If get_all_responses
is true, we wait for the responses from all the peers.
NB TODO: Will return an error if the request timeouts.
If get_all_responses
is false, we return the first successful response that we get
Sourcepub async fn get_network_density(
&self,
) -> Result<Option<KBucketDistance>, NetworkError>
pub async fn get_network_density( &self, ) -> Result<Option<KBucketDistance>, NetworkError>
Get the estimated network density (i.e. the responsible_distance_range).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Network
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnwindSafe for Network
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.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>
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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§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 moreSource§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 moreSource§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>
Source§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>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§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>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§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 moreSource§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 moreSource§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
Source§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
Source§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.Source§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.Source§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.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§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 moreSource§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 moreSource§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 moreSource§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 moreSource§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 moreSource§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 moreSource§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.Source§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.Source§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.Source§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.Source§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.Source§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.Source§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.