pub struct ReplaceTypes { /* private fields */ }hugr-passes is deprecated. Use tket::passes instead
Expand description
A lowering ComposablePass that replaces types, ops and constants, i.e. changing node signatures/interfaces.
The struct configures what types, ops, and constants should be replaced with what,
and may be applied to a Hugr via Self::run.
Parametrized types and ops will be reparameterized taking into account the
replacements, but any ops taking/returning the replaced types not as a result of
parametrization, will also need to be replaced - see Self::replace_op.
Similarly Consts.
Types that are Copyable may also be replaced with types that are not, see Linearizer.
Note that although this pass may be used before monomorphization, there are some limitations (that do not apply if done after monomorphization):
NodeTemplate::CompoundOponly works for operations that do not use type variables- โOverridesโ of specific instantiations of polymorphic types will not be detected if
the instantiations are created inside polymorphic functions. For example, suppose
we
Self::replace_typetypeAwithX,Self::replace_parametrized_typecontainerMyListwithList, andSelf::replace_typeMyList<A>withSpecialListOfXs. If a functionfoopolymorphic over a type variableTdealing withMyList<T>s, that is called with type argumentA, thenfoo<T>will be updated to deal withList<T>s and the callfoo<A>updated tofoo<X>, but this will still result in usingList<X>rather thanSpecialListOfXs. (However this would be fine after monomorphization: the monomorphic definition offoo_Awould useSpecialListOfXs.) - See also limitations noted for Linearizer.
Implementationsยง
Sourceยงimpl ReplaceTypes
impl ReplaceTypes
Sourcepub fn new_empty() -> Self
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn new_empty() -> Self
hugr-passes is deprecated. Use tket::passes instead
Makes a new instance. Unlike Self::default, this does not understand
any extension types, even those in the prelude.
Sourcepub fn replace_type(&mut self, src: CustomType, dest: Type)
๐Deprecated since 0.25.0: Use set_replace_type
pub fn replace_type(&mut self, src: CustomType, dest: Type)
Use set_replace_type
Configures this instance to replace occurrences of type src with dest.
Sourcepub fn set_replace_type(&mut self, src: CustomType, dest: Type)
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn set_replace_type(&mut self, src: CustomType, dest: Type)
hugr-passes is deprecated. Use tket::passes instead
Configures this instance to replace occurrences of type src with dest.
dest will be recursively transformed by this ReplaceTypes before replacement.
(Cases where a type should be replaced by a type containing an instance of
the first type, must be handled by two separate ReplaceTypesโs via a temporary
type. )
Note that if src is an instance of a parametrized TypeDef, this takes
precedence over Self::replace_parametrized_type where the srcs overlap. Thus, this
should only be used on already-monomorphized Hugrs, as
substitution (parametric polymorphism) happening later will not respect this replacement.
If there are any LoadConstants of this type, callers should also call Self::replace_consts
(or Self::replace_consts_parametrized) as the LoadConstants will be reparameterized
(and this will break the edge from Const to LoadConstant).
Note that if src is Copyable and dest is Linear, then (besides linearity violations)
SignatureError will be raised if this leads to an impossible type e.g. ArrayOfCopyables(src).
(This can be overridden by an additional Self::replace_type.)
Sourcepub fn replace_type_opts(
&mut self,
src: CustomType,
dest: Type,
opts: ReplacementOptions,
)
๐Deprecated since 0.25.0: Use set_replace_type
pub fn replace_type_opts( &mut self, src: CustomType, dest: Type, opts: ReplacementOptions, )
Use set_replace_type
Configures this instance to replace occurrences of type src with dest,
according to the given ReplacementOptions.
Sourcepub fn replace_parametrized_type(
&mut self,
src: &TypeDef,
dest_fn: impl Fn(&[TypeArg]) -> Option<Type> + 'static,
)
๐Deprecated since 0.25.0: Use set_replace_parametrized_type
pub fn replace_parametrized_type( &mut self, src: &TypeDef, dest_fn: impl Fn(&[TypeArg]) -> Option<Type> + 'static, )
Use set_replace_parametrized_type
Configures this instance to change occurrences of a parametrized type src
via a callback that builds the replacement type given the TypeArgs.
Sourcepub fn set_replace_parametrized_type(
&mut self,
src: &TypeDef,
dest_fn: impl Fn(&[TypeArg]) -> Option<Type> + 'static,
)
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn set_replace_parametrized_type( &mut self, src: &TypeDef, dest_fn: impl Fn(&[TypeArg]) -> Option<Type> + 'static, )
hugr-passes is deprecated. Use tket::passes instead
Configures this instance to change occurrences of a parametrized type src
via a callback that builds the replacement type given the TypeArgs.
Note that the TypeArgs will already have been updated (e.g. they may not
fit the bounds of the original type). The callback may return None to indicate
no change (in which case the supplied TypeArgs will be given to src).
The returned type will also be subject to recursive processing by this ReplaceTypes.
(Cases where a type should be replaced by a type containing an instance of
the first type, must be handled by two separate ReplaceTypesโs via a temporary
type. )
If there are any LoadConstants of any of these types, callers should also call
Self::replace_consts_parametrized (or Self::replace_consts) as the
LoadConstants will be reparameterized (and this will break the edge from Const to
LoadConstant).
See Self::set_replace_type for more details (including recursion).
Sourcepub fn replace_parametrized_type_opts(
&mut self,
src: &TypeDef,
dest_fn: impl Fn(&[TypeArg]) -> Option<Type> + 'static,
opts: ReplacementOptions,
)
๐Deprecated since 0.25.0: Use set_replace_parametrized_type
pub fn replace_parametrized_type_opts( &mut self, src: &TypeDef, dest_fn: impl Fn(&[TypeArg]) -> Option<Type> + 'static, opts: ReplacementOptions, )
Use set_replace_parametrized_type
Configures this instance to change occurrences of a parametrized type src
via a callback that builds the replacement type given the TypeArgs,
and using the given ReplacementOptions.
Sourcepub fn linearizer(&mut self) -> &mut DelegatingLinearizer
๐Deprecated since 0.25.0: Use get_linearizer or linearizer_mut
pub fn linearizer(&mut self) -> &mut DelegatingLinearizer
Use get_linearizer or linearizer_mut
Allows to configure how to deal with types/wires that were Copyable
but have become linear as a result of type-changing.
Sourcepub fn linearizer_mut(&mut self) -> &mut DelegatingLinearizer
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn linearizer_mut(&mut self) -> &mut DelegatingLinearizer
hugr-passes is deprecated. Use tket::passes instead
Allows to configure how to deal with types/wires that were Copyable but have become linear as a result of type-changing. Specifically, the Linearizer is used whenever lowering produces an outport which both
Sourcepub fn get_linearizer(&self) -> &impl Linearizer
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn get_linearizer(&self) -> &impl Linearizer
hugr-passes is deprecated. Use tket::passes instead
Allows use of the linearizer (e.g. in a callback passed to Self::set_replace_parametrized_op)
Sourcepub fn replace_op(&mut self, src: &ExtensionOp, dest: NodeTemplate)
๐Deprecated since 0.25.0: Use set_replace_op
pub fn replace_op(&mut self, src: &ExtensionOp, dest: NodeTemplate)
Use set_replace_op
Configures this instance to change occurrences of src to dest.
Sourcepub fn set_replace_op(&mut self, src: &ExtensionOp, dest: NodeTemplate)
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn set_replace_op(&mut self, src: &ExtensionOp, dest: NodeTemplate)
hugr-passes is deprecated. Use tket::passes instead
Configures this instance to change occurrences of src to dest.
The RHS will be recursively processed by this ReplaceTypes. (Cases where an op should be replaced by a container including an instance of the same op, must be handled by two separate ReplaceTypesโs via a temporary op.)
Note that if src is an instance of a parametrized OpDef, this takes
precedence over Self::set_replace_parametrized_op where the srcs overlap.
Thus, this method should only be used for already-monomorphized
Hugrs, as substitution (parametric polymorphism) happening later will not respect
this replacement.
Sourcepub fn replace_op_with(
&mut self,
src: &ExtensionOp,
dest: NodeTemplate,
opts: ReplacementOptions,
)
๐Deprecated since 0.25.0: Use set_replace_op
pub fn replace_op_with( &mut self, src: &ExtensionOp, dest: NodeTemplate, opts: ReplacementOptions, )
Use set_replace_op
Configures this instance to change occurrences of src to dest.
Sourcepub fn replace_parametrized_op(
&mut self,
src: &OpDef,
dest_fn: impl Fn(&[TypeArg]) -> Option<NodeTemplate> + 'static,
)
๐Deprecated since 0.25.0: Use set_replace_parametrized_op
pub fn replace_parametrized_op( &mut self, src: &OpDef, dest_fn: impl Fn(&[TypeArg]) -> Option<NodeTemplate> + 'static, )
Use set_replace_parametrized_op
Configures this instance to change occurrences of a parametrized op src
via a callback that builds the replacement type given the TypeArgs.
Sourcepub fn set_replace_parametrized_op(
&mut self,
src: &OpDef,
dest_fn: impl Fn(&[TypeArg], &ReplaceTypes) -> Result<Option<NodeTemplate>, ReplaceTypesError> + 'static,
)
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn set_replace_parametrized_op( &mut self, src: &OpDef, dest_fn: impl Fn(&[TypeArg], &ReplaceTypes) -> Result<Option<NodeTemplate>, ReplaceTypesError> + 'static, )
hugr-passes is deprecated. Use tket::passes instead
Configures this instance to change occurrences of a parametrized op src
via a callback that builds the replacement type given the TypeArgs.
Note that the TypeArgs will already have been updated (e.g. they may not
fit the bounds of the original op); and the returned NodeTemplate will be
recursively processed by this ReplaceTypes. (Cases where an op should be
replaced by a container including an instance of the same op, must be handled
by two separate ReplaceTypesโs via a temporary op.)
If the Callback returns None, the new typeargs will be applied to the original op.
Sourcepub fn replace_parametrized_op_with(
&mut self,
src: &OpDef,
dest_fn: impl Fn(&[TypeArg]) -> Option<NodeTemplate> + 'static,
opts: ReplacementOptions,
)
๐Deprecated since 0.25.0: Use set_replace_parametrized_op
pub fn replace_parametrized_op_with( &mut self, src: &OpDef, dest_fn: impl Fn(&[TypeArg]) -> Option<NodeTemplate> + 'static, opts: ReplacementOptions, )
Use set_replace_parametrized_op
Configures this instance to change occurrences of a parametrized op src
via a callback that builds the replacement type given the TypeArgs.
Sourcepub fn replace_consts(
&mut self,
src_ty: CustomType,
const_fn: impl Fn(&OpaqueValue, &ReplaceTypes) -> Result<Value, ReplaceTypesError> + 'static,
)
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn replace_consts( &mut self, src_ty: CustomType, const_fn: impl Fn(&OpaqueValue, &ReplaceTypes) -> Result<Value, ReplaceTypesError> + 'static, )
hugr-passes is deprecated. Use tket::passes instead
Configures this instance to change Consts of type src_ty, using
a callback that is passed the value of the constant (of that type).
Note that if src_ty is an instance of a parametrized TypeDef,
this takes precedence over Self::replace_consts_parametrized where
the src_tys overlap.
Sourcepub fn replace_consts_parametrized(
&mut self,
src_ty: &TypeDef,
const_fn: impl Fn(&OpaqueValue, &ReplaceTypes) -> Result<Option<Value>, ReplaceTypesError> + 'static,
)
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn replace_consts_parametrized( &mut self, src_ty: &TypeDef, const_fn: impl Fn(&OpaqueValue, &ReplaceTypes) -> Result<Option<Value>, ReplaceTypesError> + 'static, )
hugr-passes is deprecated. Use tket::passes instead
Configures this instance to change Consts of all types that are instances
of a parametrized typedef src_ty, using a callback that is passed the
value of the constant (the OpaqueValue contains the TypeArgs). The
callback may return None to indicate no change to the constant.
Sourcepub fn set_regions(&mut self, regions: impl IntoIterator<Item = Node>)
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn set_regions(&mut self, regions: impl IntoIterator<Item = Node>)
hugr-passes is deprecated. Use tket::passes instead
Set the regions of the Hugr to which this pass should be applied.
If not set, the pass is applied to the whole Hugr.
Each call overwrites any previous calls to set_regions and/or Self::with_scope.
Sourcepub fn change_value(&self, value: &mut Value) -> Result<bool, ReplaceTypesError>
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
pub fn change_value(&self, value: &mut Value) -> Result<bool, ReplaceTypesError>
hugr-passes is deprecated. Use tket::passes instead
Modifies the specified Value in-place according to current configuration. Returns whether the value has changed (conservative over-approximation).
Trait Implementationsยง
Sourceยงimpl Clone for ReplaceTypes
impl Clone for ReplaceTypes
Sourceยงfn clone(&self) -> ReplaceTypes
fn clone(&self) -> ReplaceTypes
1.0.0 (const: unstable) ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSourceยงimpl<H: HugrMut<Node = Node>> ComposablePass<H> for ReplaceTypes
impl<H: HugrMut<Node = Node>> ComposablePass<H> for ReplaceTypes
Sourceยงtype Error = ReplaceTypesError
type Error = ReplaceTypesError
hugr-passes is deprecated. Use tket::passes instead
Sourceยงtype Result = bool
type Result = bool
hugr-passes is deprecated. Use tket::passes instead
Sourceยงfn run(&self, hugr: &mut H) -> Result<bool, ReplaceTypesError>
fn run(&self, hugr: &mut H) -> Result<bool, ReplaceTypesError>
hugr-passes is deprecated. Use tket::passes instead
Sourceยงfn map_err<E2: Error>(
self,
f: impl Fn(Self::Error) -> E2,
) -> impl ComposablePass<H, Result = Self::Result, Error = E2>
fn map_err<E2: Error>( self, f: impl Fn(Self::Error) -> E2, ) -> impl ComposablePass<H, Result = Self::Result, Error = E2>
hugr-passes is deprecated. Use tket::passes instead
ComposablePass that has the same result type.Sourceยงfn then<P: ComposablePass<H>, E: ErrorCombiner<Self::Error, P::Error>>(
self,
other: P,
) -> impl ComposablePass<H, Result = (Self::Result, P::Result), Error = E>
fn then<P: ComposablePass<H>, E: ErrorCombiner<Self::Error, P::Error>>( self, other: P, ) -> impl ComposablePass<H, Result = (Self::Result, P::Result), Error = E>
hugr-passes is deprecated. Use tket::passes instead
ComposablePass that does โself then otherโ, so long as
other::Err can be combined with ours. Read moreSourceยงimpl Default for ReplaceTypes
impl Default for ReplaceTypes
Sourceยงimpl TypeTransformer for ReplaceTypes
impl TypeTransformer for ReplaceTypes
Sourceยงtype Err = ReplaceTypesError
type Err = ReplaceTypesError
CustomType cannot be transformed, or a type
containing it (e.g. if changing a runtime type from copyable to
linear invalidates a parameterized type).Sourceยงfn apply_custom(&self, ct: &CustomType) -> Result<Option<Type>, Self::Err>
fn apply_custom(&self, ct: &CustomType) -> Result<Option<Type>, Self::Err>
Sourceยงimpl WithScope for ReplaceTypes
impl WithScope for ReplaceTypes
Sourceยงfn with_scope(self, scope: impl Into<PassScope>) -> Self
๐Deprecated since 0.26.2: hugr-passes is deprecated. Use tket::passes instead
fn with_scope(self, scope: impl Into<PassScope>) -> Self
hugr-passes is deprecated. Use tket::passes instead
Sets the scope within which the pass will operate. Note that this pass ignores
- PassScope::preserve_interface, as this is a lowering pass: its purpose is to change node signatures.
- PassScope::recursive, as non-recursion generally leads to invalid Hugrs.
Hence, really only the PassScope::root affects the pass.
Auto Trait Implementationsยง
impl !RefUnwindSafe for ReplaceTypes
impl !Send for ReplaceTypes
impl !Sync for ReplaceTypes
impl !UnwindSafe for ReplaceTypes
impl Freeze for ReplaceTypes
impl Unpin for ReplaceTypes
impl UnsafeUnpin for ReplaceTypes
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<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>, which can then be
downcast into Box<dyn 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>, which 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> FmtForward for T
impl<T> FmtForward for T
Sourceยงfn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Sourceยงfn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Sourceยงfn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Sourceยงfn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Sourceยงfn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Sourceยงfn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Sourceยงfn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Sourceยงfn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> 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> Pointable for T
impl<T> Pointable for T
Sourceยงimpl<T> Tap for T
impl<T> Tap for T
Sourceยงfn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSourceยงfn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSourceยงfn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSourceยงfn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSourceยงfn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSourceยงfn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSourceยงfn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Sourceยงfn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Sourceยงfn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Sourceยงfn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Sourceยงfn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Sourceยงfn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Sourceยงfn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.