pub struct Model { /* private fields */ }Expand description
A validated physics model with fallible, indexed lookups.
Implementations§
Source§impl Model
impl Model
Sourcepub fn standard_model() -> Self
pub fn standard_model() -> Self
Load a fresh copy of the complete embedded Standard Model (sm).
Includes 43 particles and 163 vertices with their default parameter values. The compressed data is decoded on demand, without file access or a Python/UFO runtime.
Sourcepub fn qcd() -> Self
pub fn qcd() -> Self
The Standard Model’s QCD sector: six quark flavors, gluons, and gluon ghosts. Keeps the Standard Model parameters and their default values.
Sourcepub fn qed() -> Self
pub fn qed() -> Self
The Standard Model’s QED sector: photons and all charged fermions, including quarks. Keeps the Standard Model parameters and their defaults.
Sourcepub fn electroweak() -> Self
pub fn electroweak() -> Self
The electroweak Standard Model, including quarks, Higgs, Goldstones, and electroweak ghosts, with gluons and gluon ghosts removed.
Sourcepub fn qcd_qed() -> Self
pub fn qcd_qed() -> Self
Strong and electromagnetic interactions of all quarks and charged leptons, including gluon ghosts, with Standard Model parameters.
Sourcepub fn yang_mills() -> Self
pub fn yang_mills() -> Self
Pure SU(3) Yang–Mills theory: gluons and gluon ghosts, without quarks. Preserves the Standard Model parameters and their default values.
Sourcepub fn phi3() -> Self
pub fn phi3() -> Self
One real scalar phi with L_int = -g phi^3 / 3!.
External parameters mass and g default to one; the width is zero.
Sourcepub fn phi4() -> Self
pub fn phi4() -> Self
One real scalar phi with L_int = -lam phi^4 / 4!.
External parameters mass and lam default to one; the width is zero.
Sourcepub fn phi_3_4() -> Self
pub fn phi_3_4() -> Self
One real scalar phi with L_int = -g phi^3 / 3! - lam phi^4 / 4!.
External parameters mass, g, and lam default to one; the width is zero.
Sourcepub fn scalar_qed() -> Self
pub fn scalar_qed() -> Self
Scalar electrodynamics in Feynman gauge, with a, phi+, and phi-.
mass and e default to one, and lam defaults to zero. The scalar
potential is mass^2 |phi|^2 + lam |phi|^4 / 4; all widths vanish.
Source§impl Model
impl Model
Sourcepub fn with_parameter_display_transaction<T, E>(
operation: impl FnOnce() -> Result<T, E>,
) -> Result<T, E>
pub fn with_parameter_display_transaction<T, E>( operation: impl FnOnce() -> Result<T, E>, ) -> Result<T, E>
Publish model-owned parameter labels only if a synchronous operation succeeds.
Use this around model construction and application-level validation when the application can reject an otherwise valid model. Existing expressions keep their committed labels until the operation returns successfully. Nested successful operations join their parent’s transaction. A failure or panic discards pending updates without reverting other threads’ work.
Use this around a complete decode when the format or enclosing object
can fail after deserializing a valid model value, for example when Serde
checks for trailing input. For a standalone JSON document, prefer
Self::from_json, which parses the complete definition before
constructing the model.
Parsing still interns immutable symbols and their printing callbacks. This transaction stages label values on the calling thread; worker-thread model imports have their own independent registration scope.
Sourcepub fn register_parameter_symbol(
name: &str,
texname: Option<&str>,
typstname: Option<&str>,
) -> Result<(), ModelError>
pub fn register_parameter_symbol( name: &str, texname: Option<&str>, typstname: Option<&str>, ) -> Result<(), ModelError>
Declare a parameter’s printer before parsing model expressions.
Import adapters which parse expressions before constructing a Model
must call this for every parameter first, including forward references.
Repeated declarations update labels; missing/empty labels restore the
ordinary spelling. Existing user-declared symbol printers are preserved.
Sourcepub fn register_parameter_display(
name: &str,
texname: Option<&str>,
typstname: Option<&str>,
mathml: Option<&ParameterMathMl>,
) -> Result<(), ModelError>
pub fn register_parameter_display( name: &str, texname: Option<&str>, typstname: Option<&str>, mathml: Option<&ParameterMathMl>, ) -> Result<(), ModelError>
Register model-owned symbolic labels for LaTeX, Typst, and native MathML.
The MathML label is a presentation fragment, without a wrapping <math>.
Missing labels retain the ordinary symbol spelling in that format. Importers
validate every label in a model before calling this function.
§Errors
Returns an error for a malformed symbol name.
Source§impl Model
impl Model
Sourcepub fn empty(name: impl Into<String>) -> Self
pub fn empty(name: impl Into<String>) -> Self
Construct an empty, validated model for application state that has not loaded a physics model yet.
Sourcepub fn covariant_cut_multiplets(&self) -> &BTreeMap<i64, [i64; 4]>
pub fn covariant_cut_multiplets(&self) -> &BTreeMap<i64, [i64; 4]>
Physical vector PDG -> [vector, Goldstone, ghost, antighost]. Equal masses do not infer a quartet.
Sourcepub fn covariant_cut_multiplets_mut(&mut self) -> &mut BTreeMap<i64, [i64; 4]>
pub fn covariant_cut_multiplets_mut(&mut self) -> &mut BTreeMap<i64, [i64; 4]>
Invalidate the model identity before editing its covariant partner declarations.
Call Self::validate_covariant_cut_multiplets after editing.
pub fn validate_covariant_cut_multiplets(&self) -> Result<(), ModelError>
Sourcepub fn covariant_cut_states(
&self,
states: &[Vec<i64>],
) -> Result<Vec<Vec<i64>>, ModelError>
pub fn covariant_cut_states( &self, states: &[Vec<i64>], ) -> Result<Vec<Vec<i64>>, ModelError>
Covariant completeness acts on whole final-state multisets. Mixed vector/Goldstone states and the two ghost charges remain distinct; graph automorphisms supply their symmetry factors exactly once.
pub fn from_json(json: &str) -> Result<Self, ModelError>
pub fn from_path(path: impl AsRef<Path>) -> Result<Self, ModelError>
pub fn to_json(&self) -> Result<String, ModelError>
pub fn to_json_pretty(&self) -> Result<String, ModelError>
pub fn write_json(&self, path: impl AsRef<Path>) -> Result<(), ModelError>
pub fn fingerprint(&self) -> ModelFingerprint
Sourcepub fn structure_fingerprint(&self) -> ModelFingerprint
pub fn structure_fingerprint(&self) -> ModelFingerprint
The Self::fingerprint of this model with every numeric parameter and
coupling value removed.
It identifies what serialized diagrams bind to: particles and their order, vertex rules, propagators, parameter names and expressions, couplings and orders. Updating parameter values, or evaluating dependents with another floating-point library, keeps it unchanged.
Sourcepub fn simplify_zero_values(&mut self) -> Result<(), ModelError>
pub fn simplify_zero_values(&mut self) -> Result<(), ModelError>
Remove parameters and interactions that evaluate to zero, rebuilding all typed identifiers atomically after compaction.
pub fn name(&self) -> &str
pub fn restriction(&self) -> Option<&str>
Sourcepub fn with_restriction(
&self,
restriction: Option<String>,
) -> Result<Self, ModelError>
pub fn with_restriction( &self, restriction: Option<String>, ) -> Result<Self, ModelError>
Return an independently validated model with updated restriction metadata.
The original model is left unchanged, and the returned model has its own canonical fingerprint. This keeps restriction changes from bypassing the model’s validation and indexing boundary.
pub fn orders(&self) -> &[Order]
pub fn parameters(&self) -> &[Parameter]
pub fn particles(&self) -> &[Particle]
pub fn propagators(&self) -> &[Propagator]
pub fn lorentz_structures(&self) -> &[LorentzStructure]
pub fn couplings(&self) -> &[Coupling]
pub fn vertex_rules(&self) -> &[VertexRule]
pub fn functions(&self) -> &[ModelFunction]
pub fn form_factors(&self) -> &[ModelFormFactor]
pub fn particle_id(&self, name: &str) -> Result<ParticleId, ModelError>
pub fn particle_id_by_pdg(&self, pdg: i64) -> Result<ParticleId, ModelError>
pub fn particle(&self, name: &str) -> Result<&Particle, ModelError>
pub fn particle_by_pdg(&self, pdg: i64) -> Result<&Particle, ModelError>
pub fn particle_by_id(&self, id: ParticleId) -> Result<&Particle, ModelError>
pub fn particle_id_at(&self, index: usize) -> Result<ParticleId, ModelError>
pub fn antiparticle(&self, particle: &Particle) -> Result<&Particle, ModelError>
pub fn particle_is_self_conjugate(&self, particle: ParticleId) -> bool
pub fn particle_mass( &self, particle: ParticleId, ) -> Result<&Parameter, ModelError>
pub fn particle_width( &self, particle: ParticleId, ) -> Result<&Parameter, ModelError>
pub fn particle_is_massless(&self, particle: ParticleId) -> bool
Sourcepub fn scalar_symbol(&self, name: &str) -> Option<Symbol>
pub fn scalar_symbol(&self, name: &str) -> Option<Symbol>
Look up the symbol for a parameter or coupling declared by this model.
use feynkit_model::Model;
use symbolica::symbol;
assert_eq!(Model::phi4().scalar_symbol("lam"), Some(symbol!("UFO::lam")));pub fn parameter_id(&self, name: &str) -> Result<ParameterId, ModelError>
pub fn parameter(&self, name: &str) -> Result<&Parameter, ModelError>
pub fn parameter_by_id(&self, id: ParameterId) -> Result<&Parameter, ModelError>
pub fn coupling_id(&self, name: &str) -> Result<CouplingId, ModelError>
pub fn coupling(&self, name: &str) -> Result<&Coupling, ModelError>
pub fn coupling_by_id(&self, id: CouplingId) -> Result<&Coupling, ModelError>
Sourcepub fn expand_couplings(&self, expression: &Atom) -> Atom
pub fn expand_couplings(&self, expression: &Atom) -> Atom
Replace named UFO vertex coefficients by their analytic model expressions.
Generated diagrams deliberately retain symbols such as UFO::GC_11 so
numerical consumers can use the model’s precomputed coupling values.
This non-mutating expansion is the explicit boundary for symbolic
inspection and algebra in terms of the underlying model parameters.
Sourcepub fn expand_parameters(&self, expression: &Atom) -> Result<Atom, ModelError>
pub fn expand_parameters(&self, expression: &Atom) -> Result<Atom, ModelError>
Expand internal analytic parameter definitions to their external inputs.
Linnet orders the definitions by their dependencies, and Symbolica performs the exact substitutions. External parameters and internal parameters with only numerical values remain symbolic: this never reads a parameter card or converts binary64 defaults into symbolic constants.
All internal analytic definitions must be acyclic, including unused ones. The cycle error lists definitions still blocked by a cycle, which may include definitions depending on that cycle. The model and input expression are unchanged, and applying this expansion twice gives the same result.
pub fn order_id(&self, name: &str) -> Result<OrderId, ModelError>
pub fn order(&self, name: &str) -> Result<&Order, ModelError>
pub fn order_by_id(&self, id: OrderId) -> Result<&Order, ModelError>
pub fn propagator_id(&self, name: &str) -> Result<PropagatorId, ModelError>
pub fn propagator(&self, name: &str) -> Result<&Propagator, ModelError>
pub fn propagator_by_id( &self, id: PropagatorId, ) -> Result<&Propagator, ModelError>
Sourcepub fn particle_propagator(
&self,
particle: &Particle,
) -> Result<Option<(PropagatorId, bool)>, ModelError>
pub fn particle_propagator( &self, particle: &Particle, ) -> Result<Option<(PropagatorId, bool)>, ModelError>
Resolve a particle’s explicit or default propagator, then its antiparticle’s. The boolean records whether the template belongs to the antiparticle and its numerator slots must be reversed during instantiation.
pub fn propagator_id_at(&self, index: usize) -> Result<PropagatorId, ModelError>
pub fn lorentz_structure_id( &self, name: &str, ) -> Result<LorentzStructureId, ModelError>
pub fn lorentz_structure( &self, name: &str, ) -> Result<&LorentzStructure, ModelError>
pub fn lorentz_structure_by_id( &self, id: LorentzStructureId, ) -> Result<&LorentzStructure, ModelError>
pub fn vertex_rule_id(&self, name: &str) -> Result<VertexRuleId, ModelError>
pub fn vertex_rule(&self, name: &str) -> Result<&VertexRule, ModelError>
pub fn vertex_rule_by_id( &self, id: VertexRuleId, ) -> Result<&VertexRule, ModelError>
pub fn vertex_rule_id_at( &self, index: usize, ) -> Result<VertexRuleId, ModelError>
pub fn function(&self, name: &str) -> Result<&ModelFunction, ModelError>
pub fn function_id(&self, name: &str) -> Result<ModelFunctionId, ModelError>
pub fn function_by_id( &self, id: ModelFunctionId, ) -> Result<&ModelFunction, ModelError>
pub fn form_factor(&self, name: &str) -> Result<&ModelFormFactor, ModelError>
pub fn form_factor_id( &self, name: &str, ) -> Result<ModelFormFactorId, ModelError>
pub fn form_factor_by_id( &self, id: ModelFormFactorId, ) -> Result<&ModelFormFactor, ModelError>
pub fn default_parameter_card(&self) -> Result<ParameterCard, ModelError>
Sourcepub fn apply_parameter_card(
&mut self,
card: &ParameterCard,
) -> Result<(), ModelError>
pub fn apply_parameter_card( &mut self, card: &ParameterCard, ) -> Result<(), ModelError>
Apply a parameter card atomically and invalidate dependent values not explicitly supplied by the card.
Use Self::apply_parameter_card_with to recompute those values in the
same atomic operation.
Sourcepub fn recompute_with<E>(
&mut self,
evaluator: &mut E,
) -> Result<(), RecomputeError<E::Error>>where
E: ModelEvaluator,
pub fn recompute_with<E>(
&mut self,
evaluator: &mut E,
) -> Result<(), RecomputeError<E::Error>>where
E: ModelEvaluator,
Recompute all expression-backed parameters and couplings atomically.
Sourcepub fn apply_parameter_card_with<E>(
&mut self,
card: &ParameterCard,
evaluator: &mut E,
) -> Result<(), RecomputeError<E::Error>>where
E: ModelEvaluator,
pub fn apply_parameter_card_with<E>(
&mut self,
card: &ParameterCard,
evaluator: &mut E,
) -> Result<(), RecomputeError<E::Error>>where
E: ModelEvaluator,
Apply parameter values and recompute all dependents as one atomic model update.
Source§impl Model
impl Model
Sourcepub fn scalar_bindings(
&self,
card: Option<&ParameterCard>,
overrides: &BTreeMap<Symbol, Atom>,
) -> Result<BTreeMap<Symbol, Atom>, ModelError>
pub fn scalar_bindings( &self, card: Option<&ParameterCard>, overrides: &BTreeMap<Symbol, Atom>, ) -> Result<BTreeMap<Symbol, Atom>, ModelError>
Return exact scalar bindings for this model without changing it.
The optional card is applied to a copy. External parameters and explicit
card values become exact complex rationals representing their binary64
values. Internal parameters retain their analytic definitions unless
explicitly supplied by the card; cached dependent values are never used
instead of those definitions. Couplings remain analytic until the named
dependencies are substituted, without floating-point recomputation.
Arbitrary-precision inputs can be supplied directly as atoms in
overrides. To keep a parameter for later numerical or Dual evaluation,
override it with a distinct free symbol outside the binding map; a
self-reference would instead be an unresolved dependency.
Exact overrides take precedence over both model and card definitions
before closure. Additional scalar keys are allowed. The returned map has
no dependencies on its own keys, but may retain other symbols/functions;
it is not an evaluator for arbitrary UFO functions or form factors.
Pass the restriction card explicitly even for a model to which it was previously applied: the model does not retain internal-override history.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Model
impl<'de> Deserialize<'de> for Model
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Auto Trait Implementations§
impl !Freeze for Model
impl !RefUnwindSafe for Model
impl !UnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.