Struct massa_consensus_worker::state::ConsensusState
source · pub struct ConsensusState {Show 25 fields
pub config: ConsensusConfig,
pub channels: ConsensusChannels,
pub storage: Storage,
pub genesis_hashes: Vec<BlockId>,
pub gi_head: PreHashMap<BlockId, PreHashSet<BlockId>>,
pub max_cliques: Vec<Clique>,
pub active_index_without_ops: PreHashSet<BlockId>,
pub save_final_periods: Vec<u64>,
pub latest_final_blocks_periods: Vec<(BlockId, u64)>,
pub blocks_state: BlocksState,
pub best_parents: Vec<(BlockId, u64)>,
pub to_propagate: PreHashMap<BlockId, Storage>,
pub attack_attempts: Vec<BlockId>,
pub new_final_blocks: PreHashSet<BlockId>,
pub new_stale_blocks: PreHashMap<BlockId, (Address, Slot)>,
pub launch_time: MassaTime,
pub final_block_stats: VecDeque<(MassaTime, Address, bool)>,
pub protocol_blocks: VecDeque<(MassaTime, BlockId)>,
pub stale_block_stats: VecDeque<MassaTime>,
pub stats_history_timespan: MassaTime,
pub stats_desync_detection_timespan: MassaTime,
pub wishlist: PreHashMap<BlockId, Option<SecuredHeader>>,
pub prev_blockclique: PreHashMap<BlockId, Slot>,
pub nonfinal_active_blocks_per_slot: HashMap<Slot, PreHashSet<BlockId>>,
pub(crate) massa_metrics: MassaMetrics,
}Fields§
§config: ConsensusConfigConfiguration
channels: ConsensusChannelsChannels to communicate with other modules
storage: StorageStorage
genesis_hashes: Vec<BlockId>Block ids of genesis blocks
gi_head: PreHashMap<BlockId, PreHashSet<BlockId>>Incompatibility graph: maps a block id to the block ids it is incompatible with One entry per Active Block
max_cliques: Vec<Clique>All the cliques
active_index_without_ops: PreHashSet<BlockId>ids of active blocks without ops
save_final_periods: Vec<u64>Save of latest periods
latest_final_blocks_periods: Vec<(BlockId, u64)>One (block id, period) per thread
blocks_state: BlocksStateAll the blocks we know about and their status
best_parents: Vec<(BlockId, u64)>One (block id, period) per thread TODO not sure I understand the difference with latest_final_blocks_periods
to_propagate: PreHashMap<BlockId, Storage>Blocks that need to be propagated
attack_attempts: Vec<BlockId>List of block ids we think are attack attempts
new_final_blocks: PreHashSet<BlockId>Newly final blocks
new_stale_blocks: PreHashMap<BlockId, (Address, Slot)>Newly stale block mapped to creator and slot
launch_time: MassaTimetime at which the node was launched (used for de-synchronization detection)
final_block_stats: VecDeque<(MassaTime, Address, bool)>Final block stats (time, creator, is_from_protocol)
protocol_blocks: VecDeque<(MassaTime, BlockId)>Blocks that come from protocol used for stats and ids are removed when inserted in final_block_stats
stale_block_stats: VecDeque<MassaTime>Stale block timestamp
stats_history_timespan: MassaTimethe time span considered for stats
stats_desync_detection_timespan: MassaTimethe time span considered for de-synchronization detection
wishlist: PreHashMap<BlockId, Option<SecuredHeader>>blocks we want
prev_blockclique: PreHashMap<BlockId, Slot>previous blockclique notified to Execution
nonfinal_active_blocks_per_slot: HashMap<Slot, PreHashSet<BlockId>>Blocks indexed by slot (used for multi-stake limiting). Blocks should be saved in this map when we receive the header or the full block directly.
massa_metrics: MassaMetricsmassa metrics
Implementations§
source§impl ConsensusState
impl ConsensusState
pub fn insert_parents_descendants( &mut self, add_block_id: BlockId, add_block_slot: Slot, parents_hash: Vec<BlockId>, )
pub fn compute_fitness_find_blockclique( &mut self, add_block_id: &BlockId, ) -> Result<usize, ConsensusError>
pub fn list_stale_blocks(&self, fitness_threshold: u64) -> PreHashSet<BlockId>
pub fn remove_block(&mut self, add_block_id: &BlockId, block_id: &BlockId)
pub fn list_final_blocks(&self) -> Result<PreHashSet<BlockId>, ConsensusError>
sourcepub fn get_blockclique(&self) -> PreHashSet<BlockId>
pub fn get_blockclique(&self) -> PreHashSet<BlockId>
get the clique of higher fitness
pub fn mark_final_blocks( &mut self, add_block_id: &BlockId, final_blocks: PreHashSet<BlockId>, ) -> Result<(), ConsensusError>
source§impl ConsensusState
impl ConsensusState
sourcepub fn rec_process(
&mut self,
to_ack: BTreeSet<(Slot, BlockId)>,
current_slot: Option<Slot>,
) -> Result<(), ConsensusError>
pub fn rec_process( &mut self, to_ack: BTreeSet<(Slot, BlockId)>, current_slot: Option<Slot>, ) -> Result<(), ConsensusError>
sourcefn process(
&mut self,
block_id: BlockId,
current_slot: Option<Slot>,
) -> Result<BTreeSet<(Slot, BlockId)>, ConsensusError>
fn process( &mut self, block_id: BlockId, current_slot: Option<Slot>, ) -> Result<BTreeSet<(Slot, BlockId)>, ConsensusError>
sourcefn add_block_to_graph(
&mut self,
add_block_id: BlockId,
parents_hash_period: Vec<(BlockId, u64)>,
add_block_slot: Slot,
incomp: PreHashSet<BlockId>,
inherited_incomp_count: usize,
) -> Result<(), ConsensusError>
fn add_block_to_graph( &mut self, add_block_id: BlockId, parents_hash_period: Vec<(BlockId, u64)>, add_block_slot: Slot, incomp: PreHashSet<BlockId>, inherited_incomp_count: usize, ) -> Result<(), ConsensusError>
Add a block to the graph and update the cliques, the graph dependencies and incompatibilities
§Arguments:
add_block_id: Block id of the block to addparents_hash_period: Ids and periods of the parents of the block to addadd_block_creator: Creator of the block to addadd_block_slot: Slot of the block to addincomp: Block ids of the blocks incompatible with the block to addfitness: Fitness of the block to addstorage: Storage containing all the data of the block to add
§Returns:
Success or error if any steps failed
sourcepub fn maybe_note_attack_attempt(
&mut self,
reason: &DiscardReason,
hash: &BlockId,
)
pub fn maybe_note_attack_attempt( &mut self, reason: &DiscardReason, hash: &BlockId, )
Note an attack attempt if the discard reason indicates one.
sourcefn notify_execution(&mut self, finalized_blocks: HashMap<Slot, BlockId>)
fn notify_execution(&mut self, finalized_blocks: HashMap<Slot, BlockId>)
Notify execution about blockclique changes and finalized blocks.
§Arguments:
finalized_blocks: Block that became final and need to be send to execution
sourcepub fn block_db_changed(&mut self) -> Result<(), ConsensusError>
pub fn block_db_changed(&mut self) -> Result<(), ConsensusError>
call me if the block database changed Processing of final blocks, pruning.
- propagate blocks
- Notify of attack attempts
- get new final blocks
- get blockclique
- notify Execution
- Process new final blocks
- Notify pool of new final ops
- Notify PoS of final blocks
- notify protocol of block wish list
- note new latest final periods (prune graph if changed)
- add stale blocks to stats
source§impl ConsensusState
impl ConsensusState
sourcepub fn register_block_header(
&mut self,
block_id: BlockId,
header: SecuredHeader,
current_slot: Option<Slot>,
) -> Result<(), ConsensusError>
pub fn register_block_header( &mut self, block_id: BlockId, header: SecuredHeader, current_slot: Option<Slot>, ) -> Result<(), ConsensusError>
sourcepub fn register_block(
&mut self,
block_id: BlockId,
slot: Slot,
current_slot: Option<Slot>,
storage: Storage,
created: bool,
) -> Result<(), ConsensusError>
pub fn register_block( &mut self, block_id: BlockId, slot: Slot, current_slot: Option<Slot>, storage: Storage, created: bool, ) -> Result<(), ConsensusError>
Register a new full block in the graph. Ignore genesis hashes.
§Arguments:
block_id: the block idslot: the slot of the blockcurrent_slot: the slot when this function is calledstorage: Storage containing the whole content of the blockcreated: is the block created by the node or received from the network
§Returns:
Success or error if the block is invalid or too old
sourcepub fn mark_invalid_block(&mut self, block_id: &BlockId, header: SecuredHeader)
pub fn mark_invalid_block(&mut self, block_id: &BlockId, header: SecuredHeader)
Mark a block that is in the graph as invalid.
§Arguments:
block_id: Block id of the block to mark as invalidheader: Header of the block to mark as invalid
source§impl ConsensusState
impl ConsensusState
sourcefn prune_active(
&mut self,
) -> Result<PreHashMap<BlockId, ActiveBlock>, ConsensusError>
fn prune_active( &mut self, ) -> Result<PreHashMap<BlockId, ActiveBlock>, ConsensusError>
prune active blocks and return final blocks, return discarded final blocks
fn prune_slot_waiting(&mut self)
fn prune_discarded(&mut self) -> Result<(), ConsensusError>
fn prune_waiting_for_dependencies(&mut self) -> Result<(), ConsensusError>
sourcefn prune_nonfinal_blocks_per_slot(&mut self)
fn prune_nonfinal_blocks_per_slot(&mut self)
Clear the cache of blocks indexed by slot. Slot are not saved anymore, when the block in the same thread with a equal or greater period is finalized.
source§impl ConsensusState
impl ConsensusState
sourcepub fn get_stats(&self) -> Result<ConsensusStats, ConsensusError>
pub fn get_stats(&self) -> Result<ConsensusStats, ConsensusError>
Calculate and return stats about consensus
sourcepub fn stats_tick(&mut self) -> Result<(), ConsensusError>
pub fn stats_tick(&mut self) -> Result<(), ConsensusError>
Must be called each tick to update stats. Will detect if a desynchronization happened
sourcefn check_desync(&mut self) -> Result<(), ConsensusError>
fn check_desync(&mut self) -> Result<(), ConsensusError>
Helper function for stats_tick. Checks if there are any final blocks is coming from protocol if none => we are probably desync Ignore if we are before the last_start_period
sourcefn prune_stats(&mut self) -> Result<(), ConsensusError>
fn prune_stats(&mut self) -> Result<(), ConsensusError>
Remove old stats from consensus storage
source§impl ConsensusState
impl ConsensusState
source§impl ConsensusState
impl ConsensusState
pub(crate) fn detect_multistake(&mut self, header: &SecuredHeader) -> bool
sourcepub(crate) fn convert_block_header(
&mut self,
block_id: BlockId,
header: SecuredHeader,
current_slot: Option<Slot>,
) -> Option<BlockStatus>
pub(crate) fn convert_block_header( &mut self, block_id: BlockId, header: SecuredHeader, current_slot: Option<Slot>, ) -> Option<BlockStatus>
Check if the header is valid and if it could be processed when we will receive the full block
sourcefn convert_to_discard_block_header(
&mut self,
reason: DiscardReason,
block_id: BlockId,
header: SecuredHeader,
) -> BlockStatus
fn convert_to_discard_block_header( &mut self, reason: DiscardReason, block_id: BlockId, header: SecuredHeader, ) -> BlockStatus
Store in our indexes that we discarded this block or block header
§Arguments:
reason: Read of the discard
block_id: ID of the block
header: header to save
sourcepub(crate) fn check_header(
&self,
block_id: &BlockId,
header: &SecuredHeader,
current_slot: Option<Slot>,
) -> HeaderCheckOutcome
pub(crate) fn check_header( &self, block_id: &BlockId, header: &SecuredHeader, current_slot: Option<Slot>, ) -> HeaderCheckOutcome
Process an incoming header.
Checks performed:
- Number of parents matches thread count.
- Slot above 0.
- Valid thread.
- Check that the block is older than the latest final one in thread.
- Check if it was the creator’s turn to create this block.
- Check parents are present.
- Check the topological consistency of the parents.
- Check endorsements.
- Check thread incompatibility test.
- Check grandpa incompatibility test.
- Check if the block is incompatible with a parent.
- Check if the block is incompatible with a final block.
sourcepub fn check_endorsements(
&self,
header: &SecuredHeader,
) -> EndorsementsCheckOutcome
pub fn check_endorsements( &self, header: &SecuredHeader, ) -> EndorsementsCheckOutcome
check endorsements:
- endorser was selected for that (slot, index)
- endorsed slot is
parent_in_own_threadslot
source§impl ConsensusState
impl ConsensusState
sourcepub fn get_full_active_block(
&self,
block_id: &BlockId,
) -> Option<(&ActiveBlock, &StorageOrBlock)>
pub fn get_full_active_block( &self, block_id: &BlockId, ) -> Option<(&ActiveBlock, &StorageOrBlock)>
Get a full active block
sourcefn try_get_full_active_block(
&self,
block_id: &BlockId,
) -> Result<(&ActiveBlock, &StorageOrBlock), ConsensusError>
fn try_get_full_active_block( &self, block_id: &BlockId, ) -> Result<(&ActiveBlock, &StorageOrBlock), ConsensusError>
Get a full active block
Returns an error if it was not found
pub fn get_clique_count(&self) -> usize
sourcepub fn get_blockclique_block_at_slot(&self, slot: &Slot) -> Option<BlockId>
pub fn get_blockclique_block_at_slot(&self, slot: &Slot) -> Option<BlockId>
get the blockclique (or final) block ID at a given slot, if any
sourcepub fn get_latest_blockclique_block_at_slot(&self, slot: &Slot) -> BlockId
pub fn get_latest_blockclique_block_at_slot(&self, slot: &Slot) -> BlockId
get the latest blockclique (or final) block ID at a given slot, if any
pub fn get_block_status(&self, block_id: &BlockId) -> BlockGraphStatus
sourcefn list_latest_final_blocks_at(
&self,
slot: Slot,
) -> Result<Vec<(BlockId, u64)>, ConsensusError>
fn list_latest_final_blocks_at( &self, slot: Slot, ) -> Result<Vec<(BlockId, u64)>, ConsensusError>
list the latest final blocks at the given slot
exclusively used by list_required_active_blocks
sourcefn list_earliest_blocks_of(
&self,
block_ids: &PreHashSet<BlockId>,
end_slot: Option<Slot>,
) -> Result<Vec<(BlockId, u64)>, ConsensusError>
fn list_earliest_blocks_of( &self, block_ids: &PreHashSet<BlockId>, end_slot: Option<Slot>, ) -> Result<Vec<(BlockId, u64)>, ConsensusError>
list the earliest blocks of the given block id list
exclusively used by list_required_active_blocks
sourcefn add_active_blocks_after(
&self,
kept_blocks: &mut PreHashSet<BlockId>,
lower_bound: &[(BlockId, u64)],
end_slot: Option<Slot>,
)
fn add_active_blocks_after( &self, kept_blocks: &mut PreHashSet<BlockId>, lower_bound: &[(BlockId, u64)], end_slot: Option<Slot>, )
adds to the given container every active block coming after the lower bound
exclusively used by list_required_active_blocks
sourcepub fn list_required_active_blocks(
&self,
end_slot: Option<Slot>,
) -> Result<PreHashSet<BlockId>, ConsensusError>
pub fn list_required_active_blocks( &self, end_slot: Option<Slot>, ) -> Result<PreHashSet<BlockId>, ConsensusError>
list_required_active_blocks algo:
if end_slot is None: set effective_latest_finals to be the IDs of the self.latest_final_blocks else set effective_latest_finals to be the IDs of the Active Final blocks that have the highest period in each thread but are before end_slot (included)
create a kept_blocks list of block IDs to keep initialize it with effective_latest_finals as well as all the active blocks that are after the effective_latest_finals of their thread (included) (but before end_slot (included) if it is Some)
do the following 2 times: extend kept_blocks with the parents of the current kept_blocks fill holes by adding to kept_blocks all the active block IDs whose slot is after the earliest kept_blocks of their thread (included) (but before end_slot (included) if it is Some)
return kept_blocks
pub fn extract_block_graph_part( &self, slot_start: Option<Slot>, slot_end: Option<Slot>, ) -> Result<BlockGraphExport, ConsensusError>
sourcepub fn get_all_final_blocks(
&self,
) -> HashMap<BlockId, (Slot, ExecutionBlockMetadata)>
pub fn get_all_final_blocks( &self, ) -> HashMap<BlockId, (Slot, ExecutionBlockMetadata)>
Gets all stored final blocks, not only the still-useful ones This is used when initializing Execution from Consensus. Since the Execution bootstrap snapshot is older than the Consensus snapshot, we might need to signal older final blocks for Execution to catch up.
sourcepub fn get_block_wishlist(
&self,
) -> Result<PreHashMap<BlockId, Option<SecuredHeader>>, ConsensusError>
pub fn get_block_wishlist( &self, ) -> Result<PreHashMap<BlockId, Option<SecuredHeader>>, ConsensusError>
get the current block wish list, including the operations hash.
sourcepub fn get_active_block_and_descendants(
&self,
block_id: &BlockId,
) -> PreHashSet<BlockId>
pub fn get_active_block_and_descendants( &self, block_id: &BlockId, ) -> PreHashSet<BlockId>
Trait Implementations§
source§impl Clone for ConsensusState
impl Clone for ConsensusState
source§fn clone(&self) -> ConsensusState
fn clone(&self) -> ConsensusState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ConsensusState
impl !RefUnwindSafe for ConsensusState
impl Send for ConsensusState
impl Sync for ConsensusState
impl Unpin for ConsensusState
impl !UnwindSafe for ConsensusState
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)§impl<T> Conv for T
impl<T> Conv for T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§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> 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<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§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
§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.