Skip to main content

FeynmanDiagram

Struct FeynmanDiagram 

Source
pub struct FeynmanDiagram { /* private fields */ }
Expand description

Model-aware Feynman-diagram IR backed by Linnet’s half-edge graph.

Implementations§

Source§

impl FeynmanDiagram

Source

pub fn from_compact_dot( model: Arc<Model>, parsed: DotGraph, ) -> Result<(Self, DiagramSourceMap), DiagramError>

Resolve compact physics DOT and retain the exact source-to-final map used by finalization. Consumers can transport graph-local metadata without reconstructing ownership from momentum or particle labels. final_state lists comma-separated particles; | joins allowed alternatives.

Source§

impl FeynmanDiagram

Source

pub fn to_linnest( &self, highlight: Option<&SuBitGraph>, isolated: &BTreeSet<usize>, lmb: Option<&LoopMomentumBasis>, config: &str, ) -> Result<String, DiagramError>

Emit a complete Typst document that renders this diagram with Linnest.

The document imports the canonical Linnest package tree at crates/linnest/typst, which must be available below the Typst project root together with its sibling Kurvst package and the shared physics styles in assets/embedded/drawing/templates. Particle spin, color, charge, mass, and TeX names select line patterns, arrows, and labels. Interaction vertices retain their native identifiers. Amplitude external legs are dangling half-edges and retain their names, indices, and incoming/outgoing states as edge data.

GammaLoop’s shared physics layout owns particle styling, label measurement, force settings, and left/right amplitude placement. Finalized cross sections contain paired initial-state edges, opened for drawing by default. Set options.split-initial-state to false to retain their sewn appearance. Inspection and highlighting always refer to the original diagram.

A native half-edge selection highlights the corresponding structural halves while retaining the complete graph and its particle styles. The complement is faded and dotted; an empty selection fades everything. Selected isolated vertices are supplied separately from the half-edges. config is a trusted native Typst configuration expression, serialized by Linnet at the Python boundary. The optional basis is validated against this graph; its signatures supply momentum labels and SVG inspection metadata.

Source§

impl FeynmanDiagram

Source

pub fn numerator_of<S: SubGraphLike + SubSetOps>( &self, subgraph: &S, without: &S, ) -> Result<SymbolicTensor<PartialStructure>, DiagramError>

Construct the selected local numerator using the same boundary and exclusion rules as GammaLoop. Diagram-wide factors remain separate.

Source

pub fn denominator_of<S: SubGraphLike>( &self, subgraph: &S, edge_powers: &BTreeMap<EdgeId, isize>, ) -> Result<Atom, DiagramError>

Source

pub fn denominator_of_in_dimension<S: SubGraphLike>( &self, subgraph: &S, edge_powers: &BTreeMap<EdgeId, isize>, dimension: Dimension, ) -> Result<Atom, DiagramError>

Symbolic dimension and signed propagator powers follow the runtime UV representation, retaining its four-argument denom wrapper.

Source

pub fn superficial_degree_of_divergence_of( &self, subgraph: &SuBitGraph, dimension: i32, ) -> Result<i32, DiagramError>

Local superficial degree for a half-edge selection, including its boundary vertices and excluding physical external momentum carriers.

Source§

impl FeynmanDiagram

Source

pub fn integral_family( &self, kinematics: &Kinematics, independent_dot_products: &[Atom], ) -> Result<IntegralFamily, DiagramError>

Complete the graph propagators with preferred or automatic scalar products.

Physical propagators retain their edge order. Candidates are tried in order, skipping redundant entries; automatic products fill any remaining directions. Pass an empty slice for automatic completion. Dependent propagators must be extracted with Self::propagator_family and partial-fractioned before completing the resulting families.

Source

pub fn propagator_family( &self, kinematics: &Kinematics, ) -> Result<IntegralFamily, DiagramError>

Build an integral family from the diagram’s internal quadratic propagators.

Denominators follow ascending internal edge IDs, retaining repeated propagators and bridges. The stored loop routing supplies momentum names; dependent external coordinates are eliminated by that same routing. External carriers and dummy edges are excluded by the shared denominator builder. Symbolic masses follow its conventions, including UFO ZERO. Widths, prescriptions and custom UFO denominator formulas are not inferred. Tree diagrams have no loop-integral family and return an error. Use IntegralFamily::from_diagram to append auxiliary scalar products and obtain a complete independent denominator basis.

Source

pub fn ordered_propagators( &self, kinematics: &Kinematics, ) -> Result<Vec<(EdgeId, Atom)>, DiagramError>

Extract internal quadratic propagators together with their source edge IDs.

Entries follow ascending edge IDs and use the same routing, masses and exclusions as Self::propagator_family. Repeated propagators and bridges retain separate entries, allowing consumers to preserve graph provenance without reconstructing denominator-selection rules.

Source§

impl FeynmanDiagram

Source

pub fn momentum_subgraph(&self) -> SuBitGraph

Momentum-carrying half-edges, excluding dummy attachments.

Source

pub fn internal_subgraph(&self) -> SuBitGraph

Propagator half-edges, excluding both dangling and sewn externals.

Source

pub fn momentum_basis_of( &self, subgraph: &SuBitGraph, ) -> Result<LoopMomentumBasis, DiagramError>

Source

pub fn loop_momentum_bases_of( &self, subgraph: &SuBitGraph, limit: usize, ) -> Result<Vec<LoopMomentumBasis>, DiagramError>

Source

pub fn compatible_momentum_basis_of( &self, subgraph: &SuBitGraph, parent: &LoopMomentumBasis, ) -> Result<LoopMomentumBasis, DiagramError>

Reuse the parent’s loop momenta on the selected propagators, routing with the same forest constraints as Self::momentum_basis_of.

Source

pub fn contracted_momentum_basis_of( &self, subgraph: &SuBitGraph, contracted: &InternalSubGraph, ) -> Result<LoopMomentumBasis, DiagramError>

Route subgraph with each component of contracted shrunk to a node, using the same forest constraints as Self::momentum_basis_of.

Source§

impl FeynmanDiagram

Source

pub fn excise( &self, subgraph: &SuBitGraph, isolated_vertices: &[VertexId], ) -> Result<Self, DiagramError>

Excise an independent diagram, preserving the valence of retained vertices.

Vertices touched by the selection retain their whole incident crown. Only internal edges with both halves selected remain paired; every other incident half becomes a dangling boundary leg. In particular, an omitted edge joining two retained vertices becomes two independent external legs. Sewn initial-state carriers are opened using the amplitude particle-flow convention. No external wavefunctions are inserted at new boundaries.

Local numerator fragments follow Self::numerator_of. Half-edge, edge and vertex indices are relabeled, and an independent momentum basis is computed. Ambiguous references to an edge split into two legs at the same vertex are rejected rather than assigned to an arbitrary leg.

A proper region has unit overall factor, numerator prefactor, projector and symmetry factor, and does not inherit whole-diagram physical or spectator cuts: it is never selection-only. Selecting every half-edge and isolated vertex returns an exact independent clone, including the original routing, global metadata and any selection-only state.

Source§

impl FeynmanDiagram

Source

pub fn initial_state_tree(&self) -> (SuBitGraph, Vec<EdgeId>)

Native half-edge selection removed from topology threshold sides.

Sewn external connections define the initial state. The edge list records the loop-independent paired edges whose attached crowns form the selection.

Source§

impl FeynmanDiagram

Source

pub fn uv_expansion_of( &self, subgraph: &SuBitGraph, uv_mass: &Atom, dimension: i32, numerator: Option<&Atom>, edge_powers: &BTreeMap<EdgeId, isize>, ) -> Result<Atom, DiagramError>

Expand the selected local integrand through its UV degree of divergence.

Only the selected region’s independent loop momenta are hard. For each loop-dependent propagator, write q = k + p and use t² / [(k + t p)² - t² m² - (1 - t²) uv_mass²]. The numerator is evaluated at k/t + p. Keeping powers through t⁰ after multiplication by t^(-dimension * loops) retains all superficially divergent terms. The bookkeeping scale is then set to one.

The result uses edge momenta and tagged denom propagators, as does denominator_of. Negate it for an additive local counterterm. A supplied numerator replaces the selected local numerator and must use edge momenta. Signed edge_powers override internal propagator powers, defaulting to one; zero omits a denominator and negative powers move it to the numerator. Powers do not change the selected region or its independent loop momenta. Entries outside the selected internal edges are ignored, as in denominator_of. Projectors, overall factors and numerator prefactors are not added. Empty and tree regions return zero. This is one simultaneous UV limit, not a recursive forest subtraction or an integrated pole counterterm.

Source§

impl FeynmanDiagram

Source

pub fn builder( model: impl Into<Arc<Model>>, name: impl Into<String>, ) -> FeynmanDiagramBuilder

Source

pub fn model(&self) -> &Model

Source

pub fn model_arc(&self) -> Arc<Model>

Source

pub fn id(&self) -> DiagramId

Source

pub fn name(&self) -> &str

Source

pub fn symmetry_factor(&self) -> u64

Return the raw automorphism order retained as generation provenance.

This value is diagnostic only. Self::overall_factor is the authoritative symbolic weight and may also include grouping or fermion signs, so runtime consumers must not apply the symmetry factor again.

Source

pub fn overall_factor(&self) -> &Atom

Source

pub fn numerator(&self) -> &SymbolicTensor<PartialStructure>

Source

pub fn with_numerator_fragments( self, vertices: impl IntoIterator<Item = (VertexId, SymbolicTensor<PartialStructure>)>, edges: impl IntoIterator<Item = (EdgeId, SymbolicTensor<PartialStructure>)>, ) -> Result<Self, DiagramError>

Replace local numerator fragments in the finalized index frame and rebuild their product. Fragment edits preserve topology and routing.

Source

pub fn denominator_expression(&self) -> Result<Atom, DiagramError>

Product of internal quadratic propagators in GammaLoop’s tagged form.

Each denom(edge, Q(edge), mass², Q(edge)² - mass²) uses the symbolic dimension gammalooprs::dim and the same momenta as the numerator. Masses remain symbolic except the UFO ZERO parameter. External carriers, widths, and an imaginary prescription are excluded. Custom UFO propagator denominators are not instantiated here.

Source

pub fn numerator_prefactor(&self) -> &SymbolicTensor<PartialStructure>

Global numerator multiplier supplied by the generation request.

Source

pub fn projector(&self) -> &SymbolicTensor<PartialStructure>

External-state projector applied to the generated numerator.

Source

pub fn loop_momentum_basis(&self) -> &LoopMomentumBasis

The routing selected during diagram finalization.

Source

pub fn cuts(&self) -> &[DiagramCut]

Physical cut partitions retained by cross-section generation.

Source

pub fn cut_particles( &self, cut: &DiagramCut, ) -> Result<Vec<ParticleId>, DiagramError>

Physical final-state particles in the stored order of a finalized cut.

The native left side contains the incoming endpoint of each sewn initial state. A source endpoint on that side carries the stored species into the final state; a target endpoint carries its antiparticle. The same orientation determines the positive-energy cut momentum routing.

Source

pub fn topology_threshold_candidates(&self) -> &[DiagramThresholdCandidate]

Complete topology-only s-channel inventory used for threshold construction.

Source

pub fn spectator_cuts(&self) -> &[DiagramSpectatorCut]

Spectator cuts that selected a selection-only cross-section diagram.

Invariant, enforced by Self::validate: a diagram with paired external connections has either at least one physical cut, or is selection-only, with a non-empty list of the spectator cuts that selected it; never neither. A selection-only diagram has no physical cuts and no threshold candidates, and a diagram without paired external connections has no spectator cuts. Selection-only diagrams support listing, display, export and re-import; amplitude and integrand construction refuse them, since physical-cut finalization for spectators does not exist.

Source

pub fn is_selection_only(&self) -> bool

Whether only spectator cuts selected this cross-section diagram.

Source

pub fn with_spectator_cuts( self, spectator_cuts: Vec<DiagramSpectatorCut>, ) -> Result<Self, DiagramError>

Replace the spectator cuts of a selection-only diagram and refresh its ID.

Source

pub fn underlying(&self) -> &HedgeGraph<DiagramEdge, DiagramVertex>

Source

pub fn vertices(&self) -> impl Iterator<Item = (VertexId, &DiagramVertex)>

Source

pub fn edges( &self, ) -> impl Iterator<Item = (EdgeId, EdgeEndpoints, &DiagramEdge)>

Source

pub fn vertex(&self, id: impl Into<Option<VertexId>>) -> Option<&DiagramVertex>

Source

pub fn map_data<V, E>( &self, map_vertex: V, map_edge: E, ) -> Result<Self, DiagramError>

Transform vertex and edge metadata without changing the diagram topology or stable identifiers.

Source

pub fn canonical_key(&self) -> Result<CanonicalDiagramKey, DiagramError>

Build a deterministic key for the model-resolved colored topology.

Canonical labeling is delegated to Symbolica’s graph implementation. Particle/antiparticle edge representations are normalized so reversing a directed edge with Self::reverse_edge does not change the key.

Source

pub fn reverse_edge(&self, edge_id: EdgeId) -> Result<Self, DiagramError>

Reverse a directed edge while preserving its physical particle flow.

Reversal swaps the endpoints and replaces the referenced particle with its antiparticle. Undirected edges are unchanged. The returned diagram is fully model-validated and retains all stable identifiers.

Source

pub fn relabel_external_legs( &self, relabeling: &BTreeMap<usize, usize>, ) -> Result<Self, DiagramError>

Atomically relabel external indices, leaving unspecified legs unchanged.

Source

pub fn with_name(self, name: impl Into<String>) -> Self

Return this diagram with a finalized deterministic name.

Source

pub fn with_overall_factor(self, factor: Atom) -> Self

Return this diagram with a finalized numerator-independent multiplier.

Source

pub fn with_numerator( self, numerator: SymbolicTensor<PartialStructure>, ) -> Result<Self, DiagramError>

Return this diagram with a replacement scalar or tensor numerator.

The replacement becomes the numerator fragment of the first interaction vertex; every other vertex and edge fragment becomes one. This keeps the aggregate numerator authoritative while preserving the interaction and particle assignments needed to interpret the topology. A diagram without an interaction vertex cannot own such a replacement. Diagram IDs identify the model-resolved topology and remain unchanged.

Source

pub fn with_numerator_prefactor( self, prefactor: SymbolicTensor<PartialStructure>, ) -> Self

Replace the global numerator multiplier in the finalized index frame.

Local numerator fragments, their aggregate, topology and routing remain unchanged. This replaces the previous multiplier without multiplying it into the local fragments or re-inferring its logical ports and proofs.

Source

pub fn with_projector(self, projector: SymbolicTensor<PartialStructure>) -> Self

Return this diagram with a replacement external-state projector.

The projector is numerator payload and therefore does not alter the topology-derived diagram ID.

Source

pub fn with_cuts(self, cuts: Vec<DiagramCut>) -> Result<Self, DiagramError>

Replace the finalized physical cuts and refresh the content-derived ID.

Installing physical cuts supersedes a selection-only state, so any spectator cuts are dropped when cuts is non-empty.

Source

pub fn with_topology_threshold_candidates( self, candidates: Vec<DiagramThresholdCandidate>, ) -> Result<Self, DiagramError>

Replace the complete topology-only threshold inventory.

Source

pub fn with_topology_threshold_partitions( self, partitions: Vec<(Vec<DiagramHalfEdge>, Vec<DiagramHalfEdge>)>, ) -> Result<Self, DiagramError>

Install topology-only threshold candidates from complete half-edge partitions.

Source

pub fn with_cut_partitions( self, partitions: Vec<(Vec<DiagramHalfEdge>, Vec<DiagramHalfEdge>)>, ) -> Result<Self, DiagramError>

Install physical cuts from authoritative left/right half-edge partitions.

The oriented crossing endpoints, coupling-order summaries, and loop counts are derived from this diagram’s finalized topology. This is the appropriate constructor when a valid partition is transported onto an isomorphic representative whose interaction assignment may differ. Supplied half-edge IDs must already use this diagram’s edge-ID frame.

Source

pub fn half_edge_id(&self, half_edge: DiagramHalfEdge) -> Option<Hedge>

Resolve a stable endpoint reference to its native Linnet half-edge.

Source

pub fn half_edges(&self) -> impl Iterator<Item = DiagramHalfEdge> + '_

Enumerate existing half-edges, in their native channel order.

Source

pub fn with_loop_momentum_edges( self, requested: &[EdgeId], ) -> Result<Self, DiagramError>

Select a spanning-forest routing by its ordered independent edges.

Source

pub fn with_loop_momentum_tree_edges( self, requested: &[EdgeId], ) -> Result<Self, DiagramError>

Select a spanning-forest routing by its ordered tree edges.

The requested edges are validated and materialized directly. This is useful when a generator already chose a deterministic spanning forest: it does not enumerate the other spanning forests of the diagram.

Source

pub fn with_canonical_loop_momentum_basis(self) -> Result<Self, DiagramError>

Select the first spanning-forest routing in the canonical topology order historically used by GammaLoop’s sorted_g graphs.

Stable FeynKit edge IDs remain the momentum labels. Only the ordering used to choose the default tree is changed, so the coordinate convention is fixed before downstream transport.

Source

pub fn with_first_loop_momentum_basis_in_edge_order( self, ordered: &[EdgeId], ) -> Result<Self, DiagramError>

Select the first depth-first basis for an explicit internal-edge order.

Paired cross-section connections root the traversal at the attachment retained as hedge zero by legacy sewing (the outgoing side), in connection order. One-sided amplitude connections use their only attachment. No other spanning forests are enumerated. Generators can therefore reproduce a pre-existing half-edge insertion convention without moving topology or routing ownership into a downstream runtime.

Source

pub fn to_json(&self) -> Result<String, DiagramError>

Source

pub fn from_json( model: impl Into<Arc<Model>>, input: &str, ) -> Result<Self, DiagramError>

Source

pub fn validate(&self) -> Result<(), DiagramError>

Check model references and the structural invariants expected of a generated Feynman diagram.

Source

pub fn to_dot(&self) -> Result<String, DiagramError>

Serialize to a stable DOT dialect that can be parsed by Self::from_dot.

Source

pub fn from_dot( model: impl Into<Arc<Model>>, input: &str, ) -> Result<Self, DiagramError>

Parse compact model-aware DOT or the stable dialect emitted by Self::to_dot.

Source

pub fn from_dot_set( model: impl Into<Arc<Model>>, input: &str, ) -> Result<Vec<Self>, DiagramError>

Parse one or more model-aware FeynKit DOT diagrams from a single document.

Each graph accepts the same compact or annotated dialect as Self::from_dot. Annotated exports must carry the structure fingerprint of model; numeric parameter values may differ. A legacy full model fingerprint is accepted only for the unchanged model. This is the canonical import path for a set of finalized cross-section diagrams because their typed physical cuts are retained graph by graph.

Source

pub fn loop_count(&self) -> usize

Source

pub fn superficial_degree_of_divergence( &self, dimension: i32, ) -> Result<i32, DiagramError>

Return the local superficial UV degree in dimension spacetime dimensions.

This is dimension * loops + sum(vertex degrees) + sum(edge degrees - 2). Degrees come from the stored local numerators; each internal propagator contributes its quadratic denominator. External legs, the projector, and diagram-wide prefactors are excluded, as in GammaLoop’s local UV counting. All momenta at a vertex scale together. This is a superficial bound, not a test of cancellations in the contracted numerator or of subdivergences. Zero means logarithmic, positive means power divergent, and negative means superficially convergent.

Source

pub fn loop_momentum_bases( &self, ) -> Result<Vec<LoopMomentumBasis>, DiagramError>

Enumerate every spanning-forest-induced loop momentum basis.

Source

pub fn loop_momentum_bases_with_limit( &self, limit: usize, ) -> Result<Vec<LoopMomentumBasis>, DiagramError>

Enumerate at most limit loop momentum bases.

Trait Implementations§

Source§

impl Clone for FeynmanDiagram

Source§

fn clone(&self) -> FeynmanDiagram

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FeynmanDiagram

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for FeynmanDiagram

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AtomComponentOptimizable<()> for T

Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
§

impl<T> Pipe for T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows 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) -> R
where R: 'a,

Mutably borrows 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
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryFromUpgrade<T> for U
where T: TrySmallestUpgrade<U, LCM = U>, U: Clone,

§

fn try_from_upgrade(value: &T) -> Option<U>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> TryIntoUpgrade<U> for T
where U: TryFromUpgrade<T>,

§

fn try_into_upgrade(&self) -> Option<U>

Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.