pub struct Hugr { /* private fields */ }
Expand description
The Hugr data structure.
Implementations§
source§impl Hugr
impl Hugr
sourcepub fn validate(
&self,
extension_registry: &ExtensionRegistry,
) -> Result<(), ValidationError>
pub fn validate( &self, extension_registry: &ExtensionRegistry, ) -> Result<(), ValidationError>
Check the validity of the HUGR, assuming that it has no open extension variables. TODO: Add a version of validation which allows for open extension variables (see github issue #457)
sourcepub fn validate_no_extensions(
&self,
extension_registry: &ExtensionRegistry,
) -> Result<(), ValidationError>
pub fn validate_no_extensions( &self, extension_registry: &ExtensionRegistry, ) -> Result<(), ValidationError>
Check the validity of the HUGR, but don’t check consistency of extension requirements between connected nodes or between parents and children.
sourcepub fn validate_extensions(&self) -> Result<(), ValidationError>
pub fn validate_extensions(&self) -> Result<(), ValidationError>
Validate extensions, i.e. that extension deltas from parent nodes are reflected in their children.
source§impl Hugr
impl Hugr
Public API for HUGRs.
sourcepub fn update_validate(
&mut self,
extension_registry: &ExtensionRegistry,
) -> Result<(), ValidationError>
pub fn update_validate( &mut self, extension_registry: &ExtensionRegistry, ) -> Result<(), ValidationError>
Resolve extension ops, infer extensions used, and pass the closure into validation
sourcepub fn infer_extensions(&mut self, remove: bool) -> Result<(), ExtensionError>
pub fn infer_extensions(&mut self, remove: bool) -> Result<(), ExtensionError>
Infers an extension-delta for any non-function container node whose current extension_delta contains TO_BE_INFERRED. The inferred delta will be the smallest delta compatible with its children and that includes any other ExtensionIds in the current delta.
If remove
is true, for such container nodes without TO_BE_INFERRED,
ExtensionIds are removed from the delta if they are not used by any child node.
The non-function container nodes are: Case, CFG, Conditional, DataflowBlock, DFG, TailLoop
source§impl Hugr
impl Hugr
Internal API for HUGRs, not intended for use by users.
sourcepub fn canonicalize_nodes(&mut self, rekey: impl FnMut(Node, Node))
pub fn canonicalize_nodes(&mut self, rekey: impl FnMut(Node, Node))
Compact the nodes indices of the hugr to be contiguous, and order them as a breadth-first traversal of the hierarchy.
The rekey function is called for each moved node with the old and new indices.
After this operation, a serialization and deserialization of the Hugr is guaranteed to preserve the indices.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hugr
impl<'de> Deserialize<'de> for Hugr
source§fn deserialize<D>(deserializer: D) -> Result<Hugr, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Hugr, D::Error>where
D: Deserializer<'de>,
source§impl ExtractHugr for &Hugr
impl ExtractHugr for &Hugr
source§fn extract_hugr(self) -> Hugr
fn extract_hugr(self) -> Hugr
source§impl ExtractHugr for &mut Hugr
impl ExtractHugr for &mut Hugr
source§fn extract_hugr(self) -> Hugr
fn extract_hugr(self) -> Hugr
source§impl ExtractHugr for Hugr
impl ExtractHugr for Hugr
source§fn extract_hugr(self) -> Hugr
fn extract_hugr(self) -> Hugr
source§impl PartialEq for Hugr
impl PartialEq for Hugr
source§impl RootTagged for &Hugr
impl RootTagged for &Hugr
§type RootHandle = Node
type RootHandle = Node
source§impl RootTagged for &mut Hugr
impl RootTagged for &mut Hugr
§type RootHandle = Node
type RootHandle = Node
source§impl RootTagged for Hugr
impl RootTagged for Hugr
§type RootHandle = Node
type RootHandle = Node
impl StructuralPartialEq for Hugr
Auto Trait Implementations§
impl Freeze for Hugr
impl !RefUnwindSafe for Hugr
impl Send for Hugr
impl Sync for Hugr
impl Unpin for Hugr
impl !UnwindSafe for Hugr
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> HugrInternals for T
impl<T> HugrInternals for T
§type Portgraph<'p> = &'p MultiPortGraph
where
T: 'p
type Portgraph<'p> = &'p MultiPortGraph where T: 'p
source§fn portgraph(&self) -> <T as HugrInternals>::Portgraph<'_>
fn portgraph(&self) -> <T as HugrInternals>::Portgraph<'_>
source§impl<T> HugrMut for T
impl<T> HugrMut for T
source§fn add_node_with_parent(
&mut self,
parent: Node,
node: impl Into<OpType>,
) -> Node
fn add_node_with_parent( &mut self, parent: Node, node: impl Into<OpType>, ) -> Node
source§fn add_node_before(
&mut self,
sibling: Node,
nodetype: impl Into<OpType>,
) -> Node
fn add_node_before( &mut self, sibling: Node, nodetype: impl Into<OpType>, ) -> Node
source§fn add_node_after(&mut self, sibling: Node, op: impl Into<OpType>) -> Node
fn add_node_after(&mut self, sibling: Node, op: impl Into<OpType>) -> Node
source§fn remove_node(&mut self, node: Node)
fn remove_node(&mut self, node: Node)
source§fn connect(
&mut self,
src: Node,
src_port: impl Into<OutgoingPort>,
dst: Node,
dst_port: impl Into<IncomingPort>,
)
fn connect( &mut self, src: Node, src_port: impl Into<OutgoingPort>, dst: Node, dst_port: impl Into<IncomingPort>, )
source§fn disconnect(&mut self, node: Node, port: impl Into<Port>)
fn disconnect(&mut self, node: Node, port: impl Into<Port>)
source§fn add_other_edge(
&mut self,
src: Node,
dst: Node,
) -> (OutgoingPort, IncomingPort)
fn add_other_edge( &mut self, src: Node, dst: Node, ) -> (OutgoingPort, IncomingPort)
OpTrait::other_input
or OpTrait::other_output
. Read moresource§fn insert_hugr(&mut self, root: Node, other: Hugr) -> InsertionResult
fn insert_hugr(&mut self, root: Node, other: Hugr) -> InsertionResult
source§fn insert_from_view(
&mut self,
root: Node,
other: &impl HugrView,
) -> InsertionResult
fn insert_from_view( &mut self, root: Node, other: &impl HugrView, ) -> InsertionResult
source§fn insert_subgraph(
&mut self,
root: Node,
other: &impl HugrView,
subgraph: &SiblingSubgraph,
) -> HashMap<Node, Node>
fn insert_subgraph( &mut self, root: Node, other: &impl HugrView, subgraph: &SiblingSubgraph, ) -> HashMap<Node, Node>
source§fn get_metadata_mut(
&mut self,
node: Node,
key: impl AsRef<str>,
) -> &mut NodeMetadata
fn get_metadata_mut( &mut self, node: Node, key: impl AsRef<str>, ) -> &mut NodeMetadata
source§fn set_metadata(
&mut self,
node: Node,
key: impl AsRef<str>,
metadata: impl Into<NodeMetadata>,
)
fn set_metadata( &mut self, node: Node, key: impl AsRef<str>, metadata: impl Into<NodeMetadata>, )
source§fn take_node_metadata(&mut self, node: Node) -> Option<NodeMetadataMap>
fn take_node_metadata(&mut self, node: Node) -> Option<NodeMetadataMap>
source§fn overwrite_node_metadata(
&mut self,
node: Node,
metadata: Option<NodeMetadataMap>,
)
fn overwrite_node_metadata( &mut self, node: Node, metadata: Option<NodeMetadataMap>, )
source§impl<T> HugrMutInternals for T
impl<T> HugrMutInternals for T
source§fn set_num_ports(&mut self, node: Node, incoming: usize, outgoing: usize)
fn set_num_ports(&mut self, node: Node, incoming: usize, outgoing: usize)
PortIndex
. Read moresource§fn add_ports(
&mut self,
node: Node,
direction: Direction,
amount: isize,
) -> Range<usize>
fn add_ports( &mut self, node: Node, direction: Direction, amount: isize, ) -> Range<usize>
PortIndex
. Read moresource§fn move_after_sibling(&mut self, node: Node, after: Node)
fn move_after_sibling(&mut self, node: Node, after: Node)
source§fn move_before_sibling(&mut self, node: Node, before: Node)
fn move_before_sibling(&mut self, node: Node, before: Node)
source§fn replace_op(
&mut self,
node: Node,
op: impl Into<OpType>,
) -> Result<OpType, HugrError>
fn replace_op( &mut self, node: Node, op: impl Into<OpType>, ) -> Result<OpType, HugrError>
source§impl<T> HugrView for T
impl<T> HugrView for T
§type Nodes<'a> = MapSpecialCase<Nodes<'a>, MapSpecialCaseFnInto<Node>>
where
T: 'a
type Nodes<'a> = MapSpecialCase<Nodes<'a>, MapSpecialCaseFnInto<Node>> where T: 'a
An Iterator over the nodes in a Hugr(View)
§type NodePorts<'a> = MapSpecialCase<NodePortOffsets, MapSpecialCaseFnInto<Port>>
where
T: 'a
type NodePorts<'a> = MapSpecialCase<NodePortOffsets, MapSpecialCaseFnInto<Port>> where T: 'a
An Iterator over (some or all) ports of a node
§type Children<'a> = MapSpecialCase<Children<'a>, MapSpecialCaseFnInto<Node>>
where
T: 'a
type Children<'a> = MapSpecialCase<Children<'a>, MapSpecialCaseFnInto<Node>> where T: 'a
An Iterator over the children of a node
§type Neighbours<'a> = MapSpecialCase<Neighbours<'a>, MapSpecialCaseFnInto<Node>>
where
T: 'a
type Neighbours<'a> = MapSpecialCase<Neighbours<'a>, MapSpecialCaseFnInto<Node>> where T: 'a
An Iterator over (some or all) the nodes neighbouring a node
§type PortLinks<'a> = MapCtx<WithCtx<PortLinks<'a>, &'a Hugr>, (Node, Port)>
where
T: 'a
type PortLinks<'a> = MapCtx<WithCtx<PortLinks<'a>, &'a Hugr>, (Node, Port)> where T: 'a
Iterator over the children of a node
§type NodeConnections<'a> = MapCtx<WithCtx<NodeConnections<'a>, &'a Hugr>, [Port; 2]>
where
T: 'a
type NodeConnections<'a> = MapCtx<WithCtx<NodeConnections<'a>, &'a Hugr>, [Port; 2]> where T: 'a
source§fn contains_node(&self, node: Node) -> bool
fn contains_node(&self, node: Node) -> bool
source§fn node_count(&self) -> usize
fn node_count(&self) -> usize
source§fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
source§fn node_ports(
&self,
node: Node,
dir: Direction,
) -> <T as HugrView>::NodePorts<'_>
fn node_ports( &self, node: Node, dir: Direction, ) -> <T as HugrView>::NodePorts<'_>
source§fn all_node_ports(&self, node: Node) -> <T as HugrView>::NodePorts<'_>
fn all_node_ports(&self, node: Node) -> <T as HugrView>::NodePorts<'_>
source§fn linked_ports(
&self,
node: Node,
port: impl Into<Port>,
) -> <T as HugrView>::PortLinks<'_>
fn linked_ports( &self, node: Node, port: impl Into<Port>, ) -> <T as HugrView>::PortLinks<'_>
source§fn node_connections(
&self,
node: Node,
other: Node,
) -> <T as HugrView>::NodeConnections<'_>
fn node_connections( &self, node: Node, other: Node, ) -> <T as HugrView>::NodeConnections<'_>
source§fn num_ports(&self, node: Node, dir: Direction) -> usize
fn num_ports(&self, node: Node, dir: Direction) -> usize
source§fn children(&self, node: Node) -> <T as HugrView>::Children<'_>
fn children(&self, node: Node) -> <T as HugrView>::Children<'_>
source§fn neighbours(
&self,
node: Node,
dir: Direction,
) -> <T as HugrView>::Neighbours<'_>
fn neighbours( &self, node: Node, dir: Direction, ) -> <T as HugrView>::Neighbours<'_>
source§fn all_neighbours(&self, node: Node) -> <T as HugrView>::Neighbours<'_>
fn all_neighbours(&self, node: Node) -> <T as HugrView>::Neighbours<'_>
node
in sequence.source§fn valid_node(&self, node: Node) -> bool
fn valid_node(&self, node: Node) -> bool
source§fn valid_non_root(&self, node: Node) -> bool
fn valid_non_root(&self, node: Node) -> bool
source§fn get_optype(&self, node: Node) -> &OpType
fn get_optype(&self, node: Node) -> &OpType
source§fn get_metadata(
&self,
node: Node,
key: impl AsRef<str>,
) -> Option<&NodeMetadata>
fn get_metadata( &self, node: Node, key: impl AsRef<str>, ) -> Option<&NodeMetadata>
source§fn get_node_metadata(&self, node: Node) -> Option<&NodeMetadataMap>
fn get_node_metadata(&self, node: Node) -> Option<&NodeMetadataMap>
source§fn node_outputs(&self, node: Node) -> OutgoingPorts<Self::NodePorts<'_>>
fn node_outputs(&self, node: Node) -> OutgoingPorts<Self::NodePorts<'_>>
node_ports
(node, Direction::Outgoing)
but preserves knowledge that the ports are OutgoingPorts.source§fn node_inputs(&self, node: Node) -> IncomingPorts<Self::NodePorts<'_>>
fn node_inputs(&self, node: Node) -> IncomingPorts<Self::NodePorts<'_>>
node_ports
(node, Direction::Incoming)
but preserves knowledge that the ports are IncomingPorts.source§fn all_linked_ports(
&self,
node: Node,
dir: Direction,
) -> Either<impl Iterator<Item = (Node, OutgoingPort)>, impl Iterator<Item = (Node, IncomingPort)>> ⓘ
fn all_linked_ports( &self, node: Node, dir: Direction, ) -> Either<impl Iterator<Item = (Node, OutgoingPort)>, impl Iterator<Item = (Node, IncomingPort)>> ⓘ
source§fn all_linked_outputs(
&self,
node: Node,
) -> impl Iterator<Item = (Node, OutgoingPort)>
fn all_linked_outputs( &self, node: Node, ) -> impl Iterator<Item = (Node, OutgoingPort)>
source§fn all_linked_inputs(
&self,
node: Node,
) -> impl Iterator<Item = (Node, IncomingPort)>
fn all_linked_inputs( &self, node: Node, ) -> impl Iterator<Item = (Node, IncomingPort)>
source§fn single_linked_port(
&self,
node: Node,
port: impl Into<Port>,
) -> Option<(Node, Port)>
fn single_linked_port( &self, node: Node, port: impl Into<Port>, ) -> Option<(Node, Port)>
source§fn single_linked_output(
&self,
node: Node,
port: impl Into<IncomingPort>,
) -> Option<(Node, OutgoingPort)>
fn single_linked_output( &self, node: Node, port: impl Into<IncomingPort>, ) -> Option<(Node, OutgoingPort)>
source§fn single_linked_input(
&self,
node: Node,
port: impl Into<OutgoingPort>,
) -> Option<(Node, IncomingPort)>
fn single_linked_input( &self, node: Node, port: impl Into<OutgoingPort>, ) -> Option<(Node, IncomingPort)>
source§fn linked_outputs(
&self,
node: Node,
port: impl Into<IncomingPort>,
) -> OutgoingNodePorts<Self::PortLinks<'_>>
fn linked_outputs( &self, node: Node, port: impl Into<IncomingPort>, ) -> OutgoingNodePorts<Self::PortLinks<'_>>
linked_ports
but preserves knowledge
that the linked ports are OutgoingPorts.source§fn linked_inputs(
&self,
node: Node,
port: impl Into<OutgoingPort>,
) -> IncomingNodePorts<Self::PortLinks<'_>>
fn linked_inputs( &self, node: Node, port: impl Into<OutgoingPort>, ) -> IncomingNodePorts<Self::PortLinks<'_>>
linked_ports
but preserves knowledge
that the linked ports are IncomingPorts.source§fn is_linked(&self, node: Node, port: impl Into<Port>) -> bool
fn is_linked(&self, node: Node, port: impl Into<Port>) -> bool
source§fn num_inputs(&self, node: Node) -> usize
fn num_inputs(&self, node: Node) -> usize
num_ports
(node, Direction::Incoming)
.source§fn num_outputs(&self, node: Node) -> usize
fn num_outputs(&self, node: Node) -> usize
num_ports
(node, Direction::Outgoing)
.source§fn input_neighbours(&self, node: Node) -> Self::Neighbours<'_>
fn input_neighbours(&self, node: Node) -> Self::Neighbours<'_>
node
.
Shorthand for neighbours
(node, Direction::Incoming)
.source§fn output_neighbours(&self, node: Node) -> Self::Neighbours<'_>
fn output_neighbours(&self, node: Node) -> Self::Neighbours<'_>
node
.
Shorthand for neighbours
(node, Direction::Outgoing)
.source§fn get_io(&self, node: Node) -> Option<[Node; 2]>
fn get_io(&self, node: Node) -> Option<[Node; 2]>
source§fn inner_function_type(&self) -> Option<Signature>
fn inner_function_type(&self) -> Option<Signature>
source§fn poly_func_type(&self) -> Option<PolyFuncType>
fn poly_func_type(&self) -> Option<PolyFuncType>
source§fn as_petgraph(&self) -> PetgraphWrapper<'_, Self>where
Self: Sized,
fn as_petgraph(&self) -> PetgraphWrapper<'_, Self>where
Self: Sized,
source§fn mermaid_string(&self) -> String
fn mermaid_string(&self) -> String
source§fn mermaid_string_with_config(&self, config: RenderConfig) -> String
fn mermaid_string_with_config(&self, config: RenderConfig) -> String
source§fn dot_string(&self) -> Stringwhere
Self: Sized,
fn dot_string(&self) -> Stringwhere
Self: Sized,
source§fn static_source(&self, node: Node) -> Option<Node>
fn static_source(&self, node: Node) -> Option<Node>
source§fn static_targets(
&self,
node: Node,
) -> Option<impl Iterator<Item = (Node, IncomingPort)>>
fn static_targets( &self, node: Node, ) -> Option<impl Iterator<Item = (Node, IncomingPort)>>
source§fn signature(&self, node: Node) -> Option<Signature>
fn signature(&self, node: Node) -> Option<Signature>
source§fn value_types(
&self,
node: Node,
dir: Direction,
) -> impl Iterator<Item = (Port, Type)>
fn value_types( &self, node: Node, dir: Direction, ) -> impl Iterator<Item = (Port, Type)>
source§fn in_value_types(
&self,
node: Node,
) -> impl Iterator<Item = (IncomingPort, Type)>
fn in_value_types( &self, node: Node, ) -> impl Iterator<Item = (IncomingPort, Type)>
source§fn out_value_types(
&self,
node: Node,
) -> impl Iterator<Item = (OutgoingPort, Type)>
fn out_value_types( &self, node: Node, ) -> impl Iterator<Item = (OutgoingPort, Type)>
source§fn validate(&self, reg: &ExtensionRegistry) -> Result<(), ValidationError>
fn validate(&self, reg: &ExtensionRegistry) -> Result<(), ValidationError>
source§fn validate_no_extensions(
&self,
reg: &ExtensionRegistry,
) -> Result<(), ValidationError>
fn validate_no_extensions( &self, reg: &ExtensionRegistry, ) -> Result<(), ValidationError>
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> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
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.