pub struct CombinatorContext {
name: Identifier,
inner: Arc<dyn HasDiagnosticsBase>,
}
Expand description
A context for combinators.
You may call any method and access any field defined on Context
. In
addition all diagnostics messages emitted from this struct will carry the
name of the combinator.
See the module level documentation for more information on diagnostic context management.
Fields§
§name: Identifier
§inner: Arc<dyn HasDiagnosticsBase>
Implementations§
Source§impl CombinatorContext
impl CombinatorContext
Sourcepub fn named_combinator<A>(
self: Arc<Self>,
name: impl Into<Identifier>,
computation: impl FnOnce(Arc<CombinatorContext>) -> A,
) -> A
pub fn named_combinator<A>( self: Arc<Self>, name: impl Into<Identifier>, computation: impl FnOnce(Arc<CombinatorContext>) -> A, ) -> A
Nest another named combinator into the diagnostic context.
See the module level documentation for more information on diagnostic context management.
pub(crate) fn new( name: impl Into<Identifier>, inner: Arc<dyn HasDiagnosticsBase>, ) -> Self
Methods from Deref<Target = RootContext>§
Sourcepub fn always_happens_before(
&self,
starting_points: impl IntoIterator<Item = GlobalNode>,
is_checkpoint: impl FnMut(GlobalNode) -> bool,
is_terminal: impl FnMut(GlobalNode) -> bool,
) -> Result<AlwaysHappensBefore>
pub fn always_happens_before( &self, starting_points: impl IntoIterator<Item = GlobalNode>, is_checkpoint: impl FnMut(GlobalNode) -> bool, is_terminal: impl FnMut(GlobalNode) -> bool, ) -> Result<AlwaysHappensBefore>
Enforce that on every data flow path from the starting_points
to is_terminal
a
node satisfying is_checkpoint
is passed.
Fails if ctrl_id
on a provided starting point is not found.
The return value contains some statistics information about the
traversal. The property holds if AlwaysHappensBefore::holds
is true.
Note that is_checkpoint
and is_terminal
will be called many times
and should thus be efficient computations. In addition they should
always return the same result for the same input.
Sourcepub fn associated_call_site(&self, node: GlobalNode) -> CallString
👎Deprecated: Use NodeExt::associated_call_site instead
pub fn associated_call_site(&self, node: GlobalNode) -> CallString
Find the call string for the statement or function that produced this node.
Sourcepub fn consuming_call_sites(
&self,
node: GlobalNode,
) -> impl Iterator<Item = CallString> + '_
👎Deprecated: Use NodeQueries::consuming_call_sites instead
pub fn consuming_call_sites( &self, node: GlobalNode, ) -> impl Iterator<Item = CallString> + '_
Call sites that consume this node directly. E.g. the outgoing edges.
Sourcepub fn controllers_by_name(
&self,
name: Identifier,
) -> impl Iterator<Item = Endpoint> + '_
pub fn controllers_by_name( &self, name: Identifier, ) -> impl Iterator<Item = Endpoint> + '_
Find all controllers that bare this name.
This function is intended for use in writing test cases. Actual policies should generally refrain from working with controller names, other than printing them in error messages or for debugging. Policies contingent on controller names are likely unsound.
Sourcepub fn controller_by_name(&self, name: Identifier) -> Result<Endpoint>
pub fn controller_by_name(&self, name: Identifier) -> Result<Endpoint>
Find a singular controller with this name.
This function should only be used in tests as the same caveats apply as
in Self::controllers_by_name
.
§Returns Err
If there is not exactly one controller of this name.
Sourcepub fn find_by_name(&self, name: impl AsRef<str>) -> Result<DefId>
pub fn find_by_name(&self, name: impl AsRef<str>) -> Result<DefId>
Find a type, controller or function id by its name.
Since many often share the same name this can fail with too many
candidates. To handle such cases use Self::find_by_path
or
Self::find_all_by_name
.
Sourcepub fn find_all_by_name(&self, name: impl AsRef<str>) -> Result<&[DefId]>
pub fn find_all_by_name(&self, name: impl AsRef<str>) -> Result<&[DefId]>
Find all types, controllers and functions with this name.
Sourcepub fn find_by_path(&self, path: impl AsRef<[Identifier]>) -> Result<DefId>
pub fn find_by_path(&self, path: impl AsRef<[Identifier]>) -> Result<DefId>
Find a type, controller or function with this path.
Sourcepub fn emit_diagnostics_may_exit(&self, w: impl Write) -> Result<()>
pub fn emit_diagnostics_may_exit(&self, w: impl Write) -> Result<()>
Dispatch and drain all queued diagnostics, aborts the program if any of them demand failure.
Sourcepub fn emit_diagnostics(&self, w: impl Write) -> Result<bool>
pub fn emit_diagnostics(&self, w: impl Write) -> Result<bool>
Dispatch and drain all queued diagnostics without aborting the program.
Sourcepub fn all_nodes(&self) -> impl Iterator<Item = GlobalNode> + '_
pub fn all_nodes(&self) -> impl Iterator<Item = GlobalNode> + '_
Returns all nodes that are in any of the PDGs
Sourcepub fn roots_where<'a>(
&'a self,
f: impl Fn(GlobalNode) -> bool + 'a,
) -> impl Iterator<Item = GlobalNode> + 'a
pub fn roots_where<'a>( &'a self, f: impl Fn(GlobalNode) -> bool + 'a, ) -> impl Iterator<Item = GlobalNode> + 'a
Return nodes that satisfy the predicate and which have no ancestors that satisfy the same predicate.
Sourcepub fn report_marker_if_absent(&self, marker: Marker)
pub fn report_marker_if_absent(&self, marker: Marker)
Emit a warning if this marker was not found in the source code.
Sourcepub fn flows_to(
&self,
src: impl IntoIterGlobalNodes,
sink: impl IntoIterGlobalNodes,
edge_type: EdgeSelection,
) -> bool
👎Deprecated: Use NodeQueries::flows_to instead
pub fn flows_to( &self, src: impl IntoIterGlobalNodes, sink: impl IntoIterGlobalNodes, edge_type: EdgeSelection, ) -> bool
Returns whether a node flows to a node through the configured edge type.
Nodes do not flow to themselves. CallArgument nodes do flow to their respective CallSites.
If you use flows_to with EdgeSelection::Control
, you might want to
consider using RootContext::has_ctrl_influence
, which additionally
considers intermediate nodes which the src node has data flow to and has
ctrl influence on the sink.
Sourcepub fn controller_argument(
&self,
ctrl_id: Endpoint,
index: u32,
) -> Option<GlobalNode>
pub fn controller_argument( &self, ctrl_id: Endpoint, index: u32, ) -> Option<GlobalNode>
Find the node that represents the index
th argument of the controller
ctrl_id
.
§Returns None
If the controller with this id does not exist or the controller has
fewer than index
arguments.
Sourcepub fn has_ctrl_influence(
&self,
influencer: impl IntoIterGlobalNodes,
target: impl IntoIterGlobalNodes,
) -> bool
pub fn has_ctrl_influence( &self, influencer: impl IntoIterGlobalNodes, target: impl IntoIterGlobalNodes, ) -> bool
Returns whether there is direct control flow influence from influencer to sink, or there is some node which is data-flow influenced by influencer
and has direct control flow influence on target
. Or as expressed in code:
some n where self.flows_to(influencer, n, EdgeSelection::Data) && self.flows_to(n, target, EdgeSelection::Control)
.
Sourcepub fn influencers(
&self,
sink: impl IntoIterGlobalNodes,
edge_type: EdgeSelection,
) -> impl Iterator<Item = GlobalNode> + '_
pub fn influencers( &self, sink: impl IntoIterGlobalNodes, edge_type: EdgeSelection, ) -> impl Iterator<Item = GlobalNode> + '_
Returns iterator over all Nodes that influence the given sink Node.
Does not return the input node. A CallSite sink will return all of the associated CallArgument nodes.
Sourcepub fn influencees(
&self,
src: impl IntoIterGlobalNodes,
edge_type: EdgeSelection,
) -> impl Iterator<Item = GlobalNode> + '_
pub fn influencees( &self, src: impl IntoIterGlobalNodes, edge_type: EdgeSelection, ) -> impl Iterator<Item = GlobalNode> + '_
Returns iterator over all Nodes that are influenced by the given src Node.
Does not return the input node. A CallArgument src will return the associated CallSite.
Sourcepub fn get_node_types(&self, node: GlobalNode) -> &[DefId]
👎Deprecated: Use NodeExt::types instead
pub fn get_node_types(&self, node: GlobalNode) -> &[DefId]
Get the type(s) of a Node.
Sourcepub fn has_marker(&self, marker: Marker, node: GlobalNode) -> bool
👎Deprecated: Use NodeExt::has_marker instead
pub fn has_marker(&self, marker: Marker, node: GlobalNode) -> bool
Returns whether the given Node has the marker applied to it directly or via its type.
Sourcepub fn all_nodes_for_ctrl(
&self,
ctrl_id: Endpoint,
) -> impl Iterator<Item = GlobalNode> + '_
pub fn all_nodes_for_ctrl( &self, ctrl_id: Endpoint, ) -> impl Iterator<Item = GlobalNode> + '_
Returns all DataSources, DataSinks, and CallSites for a Controller as Nodes.
Sourcepub fn srcs_with_type(
&self,
ctrl_id: Endpoint,
t: DefId,
) -> impl Iterator<Item = GlobalNode> + '_
pub fn srcs_with_type( &self, ctrl_id: Endpoint, t: DefId, ) -> impl Iterator<Item = GlobalNode> + '_
Returns an iterator over the data sources within controller c
that have type t
.
Sourcepub fn roots(
&self,
ctrl_id: Endpoint,
edge_type: EdgeSelection,
) -> impl Iterator<Item = GlobalNode> + '_
pub fn roots( &self, ctrl_id: Endpoint, edge_type: EdgeSelection, ) -> impl Iterator<Item = GlobalNode> + '_
Returns an iterator over all nodes that do not have any influencers of the given edge_type.
Sourcepub fn desc(&self) -> &ProgramDescription
pub fn desc(&self) -> &ProgramDescription
Returns the input ProgramDescription
.
Sourcepub fn otypes(&self, id: TypeId) -> &[TypeId]
pub fn otypes(&self, id: TypeId) -> &[TypeId]
Returns all the type alias annotation for a given type
Sourcepub fn marked_type(&self, marker: Marker) -> &[DefId]
pub fn marked_type(&self, marker: Marker) -> &[DefId]
Return all types that are marked with marker
Sourcepub fn any_flows(
&self,
from: &[GlobalNode],
to: &[GlobalNode],
edge_type: EdgeSelection,
) -> Option<(GlobalNode, GlobalNode)>
pub fn any_flows( &self, from: &[GlobalNode], to: &[GlobalNode], edge_type: EdgeSelection, ) -> Option<(GlobalNode, GlobalNode)>
Return an example pair for a flow from an source from from
to a sink
in to
if any exist.
Sourcepub fn all_controllers(&self) -> impl Iterator<Item = (Endpoint, &SPDG)>
pub fn all_controllers(&self) -> impl Iterator<Item = (Endpoint, &SPDG)>
Iterate over all defined controllers
Sourcepub fn describe_def(&self, def_id: DefId) -> DisplayDef<'_>
pub fn describe_def(&self, def_id: DefId) -> DisplayDef<'_>
Returns a DisplayDef for the given def_id
Sourcepub fn describe_node(&self, node: GlobalNode) -> DisplayNode<'_>
👎Deprecated: Use NodeExt::describe instead
pub fn describe_node(&self, node: GlobalNode) -> DisplayNode<'_>
Returns a DisplayNode for the given Node
Sourcepub fn inputs_of(&self, call_string: CallString) -> NodeCluster
pub fn inputs_of(&self, call_string: CallString) -> NodeCluster
Return which data is being read from for the modification performed at this location
Sourcepub fn outputs_of(&self, call_string: CallString) -> NodeCluster
pub fn outputs_of(&self, call_string: CallString) -> NodeCluster
Return which data is being written to at this location
Sourcepub fn node_info(&self, node: GlobalNode) -> &NodeInfo
👎Deprecated: Use NodeExt::info instead
pub fn node_info(&self, node: GlobalNode) -> &NodeInfo
Retrieve metadata about a node.
Sourcepub fn instruction_at_node(&self, node: GlobalNode) -> &InstructionInfo
pub fn instruction_at_node(&self, node: GlobalNode) -> &InstructionInfo
Retrieve metadata about the instruction executed by a specific node.
Sourcepub fn successors(
&self,
node: GlobalNode,
) -> impl Iterator<Item = GlobalNode> + '_
👎Deprecated: Use NodeExt::successors instead
pub fn successors( &self, node: GlobalNode, ) -> impl Iterator<Item = GlobalNode> + '_
Return the immediate successors of this node
Sourcepub fn predecessors(
&self,
node: GlobalNode,
) -> impl Iterator<Item = GlobalNode> + '_
👎Deprecated: Use NodeExt::predecessors instead
pub fn predecessors( &self, node: GlobalNode, ) -> impl Iterator<Item = GlobalNode> + '_
Return the immediate predecessors of this node
Sourcepub fn get_location(&self, node: GlobalNode) -> &Span
👎Deprecated: Use NodeExt::get_location instead
pub fn get_location(&self, node: GlobalNode) -> &Span
Get the span of a node
Sourcepub fn named_policy<A>(
self: Arc<Self>,
name: impl Into<Identifier>,
policy: impl FnOnce(Arc<PolicyContext>) -> A,
) -> A
pub fn named_policy<A>( self: Arc<Self>, name: impl Into<Identifier>, policy: impl FnOnce(Arc<PolicyContext>) -> A, ) -> A
Add a policy to the diagnostic context.
See the module level documentation for more information on diagnostic context management.
Sourcepub fn named_controller<A>(
self: Arc<Self>,
id: Endpoint,
policy: impl FnOnce(Arc<ControllerContext>) -> A,
) -> A
pub fn named_controller<A>( self: Arc<Self>, id: Endpoint, policy: impl FnOnce(Arc<ControllerContext>) -> A, ) -> A
Run the computation in the diagnostic context of this controller
See the module level documentation for more information on diagnostic context management.
Sourcepub fn named_combinator<A>(
self: Arc<Self>,
name: impl Into<Identifier>,
computation: impl FnOnce(Arc<CombinatorContext>) -> A,
) -> A
pub fn named_combinator<A>( self: Arc<Self>, name: impl Into<Identifier>, computation: impl FnOnce(Arc<CombinatorContext>) -> A, ) -> A
Nest another named combinator into the diagnostic context.
See the module level documentation for more information on diagnostic context management.
Sourcepub fn controller_contexts(
self: &Arc<Self>,
) -> impl Iterator<Item = Arc<ControllerContext>>
pub fn controller_contexts( self: &Arc<Self>, ) -> impl Iterator<Item = Arc<ControllerContext>>
Iterate over all defined controllers as contexts
Trait Implementations§
Source§impl HasDiagnosticsBase for CombinatorContext
impl HasDiagnosticsBase for CombinatorContext
Source§fn record(&self, diagnostic: Diagnostic)
fn record(&self, diagnostic: Diagnostic)
Source§fn as_ctx(&self) -> &RootContext
fn as_ctx(&self) -> &RootContext
Context
, usually also available via std::ops::Deref
.Auto Trait Implementations§
impl Freeze for CombinatorContext
impl !RefUnwindSafe for CombinatorContext
impl !Send for CombinatorContext
impl !Sync for CombinatorContext
impl Unpin for CombinatorContext
impl !UnwindSafe for CombinatorContext
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> Diagnostics for Twhere
T: HasDiagnosticsBase,
impl<T> Diagnostics for Twhere
T: HasDiagnosticsBase,
Source§fn struct_error(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_error(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Source§fn struct_span_error(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_span_error( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn struct_warning(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_warning(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Source§fn struct_span_warning(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_span_warning( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn struct_help(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_help(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Source§fn struct_span_help(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_span_help( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn struct_note(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_note(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Source§fn struct_span_note(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_span_note( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn error(&self, msg: impl Into<String>)
fn error(&self, msg: impl Into<String>)
Source§fn warning(&self, msg: impl Into<String>)
fn warning(&self, msg: impl Into<String>)
Source§fn note(&self, msg: impl Into<String>)
fn note(&self, msg: impl Into<String>)
Source§fn span_error(&self, msg: impl Into<String>, span: Span)
fn span_error(&self, msg: impl Into<String>, span: Span)
Source§fn span_warning(&self, msg: impl Into<String>, span: Span)
fn span_warning(&self, msg: impl Into<String>, span: Span)
Source§fn span_note(&self, msg: impl Into<String>, span: Span)
fn span_note(&self, msg: impl Into<String>, span: Span)
Source§fn span_help(&self, msg: impl Into<String>, span: Span)
fn span_help(&self, msg: impl Into<String>, span: Span)
Source§fn struct_node_error(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_node_error( &self, node: GlobalNode, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn struct_node_warning(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_node_warning( &self, node: GlobalNode, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn struct_node_note(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_node_note( &self, node: GlobalNode, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn struct_node_help(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
fn struct_node_help( &self, node: GlobalNode, msg: impl Into<String>, ) -> DiagnosticBuilder<'_, Self>
Source§fn node_error(&self, node: GlobalNode, msg: impl Into<String>)
fn node_error(&self, node: GlobalNode, msg: impl Into<String>)
Source§fn node_warning(&self, node: GlobalNode, msg: impl Into<String>)
fn node_warning(&self, node: GlobalNode, msg: impl Into<String>)
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> 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> 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> 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.