pub struct MultiPortGraph<N: Unsigned = u32, P: Unsigned = u32, PO: Unsigned = u16> { /* private fields */ }Expand description
An unlabelled port graph that allows multiple links to the same ports.
A port graph consists of a collection of nodes identified by a NodeIndex.
Each node has an ordered sequence of input and output ports, identified by a PortIndex that is unique within the graph.
To optimize for the most common use case, the number of input and output ports of a node must be specified when the node is created.
Multiple connections to the same PortIndex can be distinguished by their SubportIndex.
When a node and its associated ports are removed their indices will be reused on a best effort basis when a new node is added. The indices of unaffected nodes and ports remain stable.
Implementations§
Source§impl<PO: Unsigned> MultiPortGraph<u32, u32, PO>
impl<PO: Unsigned> MultiPortGraph<u32, u32, PO>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty MultiPortGraph.
Sourcepub fn with_capacity(nodes: usize, ports: usize) -> Self
pub fn with_capacity(nodes: usize, ports: usize) -> Self
Create a new empty MultiPortGraph with preallocated capacity.
Sourcepub fn as_portgraph(&self) -> &PortGraph<u32, u32, PO>
pub fn as_portgraph(&self) -> &PortGraph<u32, u32, PO>
Returns a reference to the internal plain portgraph.
This graph exposes the copy nodes as well as the main nodes.
Sourcepub fn pg_main_node(&self, node: NodeIndex) -> NodeIndex
pub fn pg_main_node(&self, node: NodeIndex) -> NodeIndex
Given a node in the underlying flat portgraph, returns the main node for it.
If the node is not a copy node, returns the node itself.
Trait Implementations§
Source§impl<N: Clone + Unsigned, P: Clone + Unsigned, PO: Clone + Unsigned> Clone for MultiPortGraph<N, P, PO>
impl<N: Clone + Unsigned, P: Clone + Unsigned, PO: Clone + Unsigned> Clone for MultiPortGraph<N, P, PO>
Source§fn clone(&self) -> MultiPortGraph<N, P, PO>
fn clone(&self) -> MultiPortGraph<N, P, PO>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<N: Default + Unsigned, P: Default + Unsigned, PO: Default + Unsigned> Default for MultiPortGraph<N, P, PO>
impl<N: Default + Unsigned, P: Default + Unsigned, PO: Default + Unsigned> Default for MultiPortGraph<N, P, PO>
Source§fn default() -> MultiPortGraph<N, P, PO>
fn default() -> MultiPortGraph<N, P, PO>
Source§impl From<MultiPortGraph> for PortGraph
impl From<MultiPortGraph> for PortGraph
Source§fn from(multi: MultiPortGraph) -> Self
fn from(multi: MultiPortGraph) -> Self
Source§impl From<PortGraph> for MultiPortGraph
impl From<PortGraph> for MultiPortGraph
Source§impl<PO: Unsigned> LinkMut for MultiPortGraph<u32, u32, PO>
impl<PO: Unsigned> LinkMut for MultiPortGraph<u32, u32, PO>
Source§fn link_ports(
&mut self,
port_a: PortIndex,
port_b: PortIndex,
) -> Result<(SubportIndex, SubportIndex), LinkError<PO>>
fn link_ports( &mut self, port_a: PortIndex, port_b: PortIndex, ) -> Result<(SubportIndex, SubportIndex), LinkError<PO>>
Source§fn unlink_port(&mut self, port: PortIndex) -> Option<SubportIndex>
fn unlink_port(&mut self, port: PortIndex) -> Option<SubportIndex>
port. If the port was connected,
returns one of the ports it was connected to.Source§fn link_nodes(
&mut self,
from: NodeIndex,
from_output: usize,
to: NodeIndex,
to_input: usize,
) -> Result<(Self::LinkEndpoint, Self::LinkEndpoint), LinkError<Self::PortOffsetBase>>
fn link_nodes( &mut self, from: NodeIndex, from_output: usize, to: NodeIndex, to_input: usize, ) -> Result<(Self::LinkEndpoint, Self::LinkEndpoint), LinkError<Self::PortOffsetBase>>
Source§fn link_offsets(
&mut self,
node_a: NodeIndex,
offset_a: PortOffset<Self::PortOffsetBase>,
node_b: NodeIndex,
offset_b: PortOffset<Self::PortOffsetBase>,
) -> Result<(Self::LinkEndpoint, Self::LinkEndpoint), LinkError<Self::PortOffsetBase>>
fn link_offsets( &mut self, node_a: NodeIndex, offset_a: PortOffset<Self::PortOffsetBase>, node_b: NodeIndex, offset_b: PortOffset<Self::PortOffsetBase>, ) -> Result<(Self::LinkEndpoint, Self::LinkEndpoint), LinkError<Self::PortOffsetBase>>
Source§fn insert_graph(
&mut self,
other: &impl LinkView<PortOffsetBase = Self::PortOffsetBase>,
) -> Result<HashMap<NodeIndex, NodeIndex>, LinkError<Self::PortOffsetBase>>
fn insert_graph( &mut self, other: &impl LinkView<PortOffsetBase = Self::PortOffsetBase>, ) -> Result<HashMap<NodeIndex, NodeIndex>, LinkError<Self::PortOffsetBase>>
Source§impl<PO: Unsigned> LinkView for MultiPortGraph<u32, u32, PO>
impl<PO: Unsigned> LinkView for MultiPortGraph<u32, u32, PO>
Source§type LinkEndpoint = SubportIndex
type LinkEndpoint = SubportIndex
Source§fn link_count(&self) -> usize
fn link_count(&self) -> usize
Source§fn get_connections(
&self,
from: NodeIndex,
to: NodeIndex,
) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
fn get_connections( &self, from: NodeIndex, to: NodeIndex, ) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
from
to to, i.e. in that direction. Read moreSource§fn port_links(
&self,
port: PortIndex,
) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
fn port_links( &self, port: PortIndex, ) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
MultiView) that the given port is linked to.Source§fn links(
&self,
node: NodeIndex,
direction: Direction,
) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
fn links( &self, node: NodeIndex, direction: Direction, ) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
Source§fn all_links(
&self,
node: NodeIndex,
) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
fn all_links( &self, node: NodeIndex, ) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
node in sequence.Source§fn neighbours(
&self,
node: NodeIndex,
direction: Direction,
) -> impl Iterator<Item = NodeIndex> + Clone
fn neighbours( &self, node: NodeIndex, direction: Direction, ) -> impl Iterator<Item = NodeIndex> + Clone
direction.
May contain duplicates if the graph has multiple links between nodes. Read moreSource§fn all_neighbours(
&self,
node: NodeIndex,
) -> impl Iterator<Item = NodeIndex> + Clone
fn all_neighbours( &self, node: NodeIndex, ) -> impl Iterator<Item = NodeIndex> + Clone
node in sequence.Source§fn get_connection(
&self,
from: NodeIndex,
to: NodeIndex,
) -> Option<(Self::LinkEndpoint, Self::LinkEndpoint)>
fn get_connection( &self, from: NodeIndex, to: NodeIndex, ) -> Option<(Self::LinkEndpoint, Self::LinkEndpoint)>
Source§fn connected(&self, from: NodeIndex, to: NodeIndex) -> bool
fn connected(&self, from: NodeIndex, to: NodeIndex) -> bool
Source§fn port_link(&self, port: PortIndex) -> Option<Self::LinkEndpoint>
fn port_link(&self, port: PortIndex) -> Option<Self::LinkEndpoint>
Source§fn input_links(
&self,
node: NodeIndex,
) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
fn input_links( &self, node: NodeIndex, ) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
node. Shorthand for
LinkView::links(Direction::Incoming).Source§fn output_links(
&self,
node: NodeIndex,
) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
fn output_links( &self, node: NodeIndex, ) -> impl Iterator<Item = (Self::LinkEndpoint, Self::LinkEndpoint)> + Clone
node. Shorthand for
LinkView::links(Direction::Outgoing)..Source§impl<PO: Unsigned> MultiMut for MultiPortGraph<u32, u32, PO>
impl<PO: Unsigned> MultiMut for MultiPortGraph<u32, u32, PO>
Source§fn link_subports(
&mut self,
subport_from: SubportIndex,
subport_to: SubportIndex,
) -> Result<(), LinkError<PO>>
fn link_subports( &mut self, subport_from: SubportIndex, subport_to: SubportIndex, ) -> Result<(), LinkError<PO>>
Source§fn unlink_subport(&mut self, subport: SubportIndex) -> Option<SubportIndex>
fn unlink_subport(&mut self, subport: SubportIndex) -> Option<SubportIndex>
port and returns the subport it was linked to. Returns None
when the port was not linked.Source§impl<PO: Unsigned> MultiView for MultiPortGraph<u32, u32, PO>
impl<PO: Unsigned> MultiView for MultiPortGraph<u32, u32, PO>
Source§fn subport_link(&self, subport: SubportIndex) -> Option<SubportIndex>
fn subport_link(&self, subport: SubportIndex) -> Option<SubportIndex>
port. If the port is not
connected, return None.Source§fn subports(
&self,
node: NodeIndex,
direction: Direction,
) -> impl Iterator<Item = SubportIndex> + Clone
fn subports( &self, node: NodeIndex, direction: Direction, ) -> impl Iterator<Item = SubportIndex> + Clone
node in the given direction.Source§fn all_subports(
&self,
node: NodeIndex,
) -> impl Iterator<Item = SubportIndex> + Clone
fn all_subports( &self, node: NodeIndex, ) -> impl Iterator<Item = SubportIndex> + Clone
node in sequence.Source§fn subport_inputs(
&self,
node: NodeIndex,
) -> impl Iterator<Item = Self::LinkEndpoint> + Clone
fn subport_inputs( &self, node: NodeIndex, ) -> impl Iterator<Item = Self::LinkEndpoint> + Clone
node. Read moreSource§fn subport_outputs(
&self,
node: NodeIndex,
) -> impl Iterator<Item = Self::LinkEndpoint> + Clone
fn subport_outputs( &self, node: NodeIndex, ) -> impl Iterator<Item = Self::LinkEndpoint> + Clone
node. Read moreSource§impl<N: PartialEq + Unsigned, P: PartialEq + Unsigned, PO: PartialEq + Unsigned> PartialEq for MultiPortGraph<N, P, PO>
impl<N: PartialEq + Unsigned, P: PartialEq + Unsigned, PO: PartialEq + Unsigned> PartialEq for MultiPortGraph<N, P, PO>
Source§impl<PO: Unsigned> PortMut for MultiPortGraph<u32, u32, PO>
impl<PO: Unsigned> PortMut for MultiPortGraph<u32, u32, PO>
Source§fn add_node(&mut self, incoming: usize, outgoing: usize) -> NodeIndex
fn add_node(&mut self, incoming: usize, outgoing: usize) -> NodeIndex
Source§fn remove_node(&mut self, node: NodeIndex)
fn remove_node(&mut self, node: NodeIndex)
Source§fn reserve(&mut self, nodes: usize, ports: usize)
fn reserve(&mut self, nodes: usize, ports: usize)
Source§fn set_num_ports<F>(
&mut self,
node: NodeIndex,
incoming: usize,
outgoing: usize,
rekey: F,
)
fn set_num_ports<F>( &mut self, node: NodeIndex, incoming: usize, outgoing: usize, rekey: F, )
Source§fn compact_nodes<F>(&mut self, rekey: F)
fn compact_nodes<F>(&mut self, rekey: F)
Source§fn swap_nodes(&mut self, a: NodeIndex, b: NodeIndex)
fn swap_nodes(&mut self, a: NodeIndex, b: NodeIndex)
Source§fn compact_ports<F>(&mut self, rekey: F)
fn compact_ports<F>(&mut self, rekey: F)
Source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Source§impl<PO: Unsigned> PortView for MultiPortGraph<u32, u32, PO>
impl<PO: Unsigned> PortView for MultiPortGraph<u32, u32, PO>
Source§type PortOffsetBase = PO
type PortOffsetBase = PO
Source§fn contains_node(&self, node: NodeIndex) -> bool
fn contains_node(&self, node: NodeIndex) -> bool
node.Source§fn contains_port(&self, port: PortIndex) -> bool
fn contains_port(&self, port: PortIndex) -> bool
port.Source§fn node_count(&self) -> usize
fn node_count(&self) -> usize
Source§fn port_count(&self) -> usize
fn port_count(&self) -> usize
Source§fn nodes_iter(&self) -> impl Iterator<Item = NodeIndex> + Clone
fn nodes_iter(&self) -> impl Iterator<Item = NodeIndex> + Clone
Source§fn ports_iter(&self) -> impl Iterator<Item = PortIndex> + Clone
fn ports_iter(&self) -> impl Iterator<Item = PortIndex> + Clone
Source§fn node_capacity(&self) -> usize
fn node_capacity(&self) -> usize
Source§fn port_capacity(&self) -> usize
fn port_capacity(&self) -> usize
Source§fn port_direction(&self, port: impl Into<PortIndex>) -> Option<Direction>
fn port_direction(&self, port: impl Into<PortIndex>) -> Option<Direction>
port.Source§fn port_node(&self, port: impl Into<PortIndex>) -> Option<NodeIndex>
fn port_node(&self, port: impl Into<PortIndex>) -> Option<NodeIndex>
port belongs to.Source§fn port_offset(&self, port: impl Into<PortIndex>) -> Option<PortOffset<PO>>
fn port_offset(&self, port: impl Into<PortIndex>) -> Option<PortOffset<PO>>
port within its node’s port list.Source§fn port_index(
&self,
node: NodeIndex,
offset: PortOffset<PO>,
) -> Option<PortIndex>
fn port_index( &self, node: NodeIndex, offset: PortOffset<PO>, ) -> Option<PortIndex>
Source§fn ports(
&self,
node: NodeIndex,
direction: Direction,
) -> impl Iterator<Item = PortIndex> + Clone
fn ports( &self, node: NodeIndex, direction: Direction, ) -> impl Iterator<Item = PortIndex> + Clone
node in the given direction.Source§fn all_ports(&self, node: NodeIndex) -> impl Iterator<Item = PortIndex> + Clone
fn all_ports(&self, node: NodeIndex) -> impl Iterator<Item = PortIndex> + Clone
node in sequence.Source§fn input(&self, node: NodeIndex, offset: usize) -> Option<PortIndex>
fn input(&self, node: NodeIndex, offset: usize) -> Option<PortIndex>
node. Read moreSource§fn output(&self, node: NodeIndex, offset: usize) -> Option<PortIndex>
fn output(&self, node: NodeIndex, offset: usize) -> Option<PortIndex>
node. Read moreSource§fn num_ports(&self, node: NodeIndex, direction: Direction) -> usize
fn num_ports(&self, node: NodeIndex, direction: Direction) -> usize
node in the given direction.Source§fn port_offsets(
&self,
node: NodeIndex,
direction: Direction,
) -> impl Iterator<Item = PortOffset<PO>> + Clone
fn port_offsets( &self, node: NodeIndex, direction: Direction, ) -> impl Iterator<Item = PortOffset<PO>> + Clone
Source§fn all_port_offsets(
&self,
node: NodeIndex,
) -> impl Iterator<Item = PortOffset<PO>> + Clone
fn all_port_offsets( &self, node: NodeIndex, ) -> impl Iterator<Item = PortOffset<PO>> + Clone
node in sequence.Source§fn node_port_capacity(&self, node: NodeIndex) -> usize
fn node_port_capacity(&self, node: NodeIndex) -> usize
Source§fn inputs(&self, node: NodeIndex) -> impl Iterator<Item = PortIndex> + Clone
fn inputs(&self, node: NodeIndex) -> impl Iterator<Item = PortIndex> + Clone
node. Read moreSource§fn outputs(&self, node: NodeIndex) -> impl Iterator<Item = PortIndex> + Clone
fn outputs(&self, node: NodeIndex) -> impl Iterator<Item = PortIndex> + Clone
node. Read moreSource§fn num_inputs(&self, node: NodeIndex) -> usize
fn num_inputs(&self, node: NodeIndex) -> usize
node. Read moreSource§fn num_outputs(&self, node: NodeIndex) -> usize
fn num_outputs(&self, node: NodeIndex) -> usize
node. Read moreSource§fn input_offsets(
&self,
node: NodeIndex,
) -> impl Iterator<Item = PortOffset<Self::PortOffsetBase>> + Clone
fn input_offsets( &self, node: NodeIndex, ) -> impl Iterator<Item = PortOffset<Self::PortOffsetBase>> + Clone
node. Read moreSource§fn output_offsets(
&self,
node: NodeIndex,
) -> impl Iterator<Item = PortOffset<Self::PortOffsetBase>> + Clone
fn output_offsets( &self, node: NodeIndex, ) -> impl Iterator<Item = PortOffset<Self::PortOffsetBase>> + Clone
node. Read moreimpl<N: Unsigned, P: Unsigned, PO: Unsigned> StructuralPartialEq for MultiPortGraph<N, P, PO>
Auto Trait Implementations§
impl<N, P, PO> Freeze for MultiPortGraph<N, P, PO>where
N: Freeze,
impl<N, P, PO> RefUnwindSafe for MultiPortGraph<N, P, PO>
impl<N, P, PO> Send for MultiPortGraph<N, P, PO>
impl<N, P, PO> Sync for MultiPortGraph<N, P, PO>
impl<N, P, PO> Unpin for MultiPortGraph<N, P, PO>
impl<N, P, PO> UnwindSafe for MultiPortGraph<N, P, PO>
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§impl<G> DotFormat for Gwhere
G: LinkView,
impl<G> DotFormat for Gwhere
G: LinkView,
Source§fn dot_format(&self) -> DotFormatter<'_, G>
fn dot_format(&self) -> DotFormatter<'_, G>
DotFormatter for the graph.Source§fn dot_string(&self) -> String
fn dot_string(&self) -> 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<G> MermaidFormat for Gwhere
G: LinkView,
impl<G> MermaidFormat for Gwhere
G: LinkView,
Source§fn mermaid_format(&self) -> MermaidFormatter<'_, G>
fn mermaid_format(&self) -> MermaidFormatter<'_, G>
MermaidFormatter for the graph. Read moreSource§fn mermaid_string(&self) -> String
fn mermaid_string(&self) -> String
MermaidFormat::mermaid_format for more control over the output
style. 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.