Back to Eqiora docs Skip to main content

SourceAstFactory

Struct SourceAstFactory 

pub struct SourceAstFactory;
Description

Checked factory for owned source AST values.

The factory is intentionally syntax-only. It gives parsers, elaborators, and source transforms one construction boundary without exposing mutable declaration fields or requiring a format-and-reparse cycle.

Implementations§

§

impl SourceAstFactory

pub fn dimension_alias( visibility: VisibilitySyntax, name: impl Into<String>, expression: Expr, range: TextRange, ) -> Result<NamedDefinitionDecl, AstConstructionError>

Construct one compilation-unit structural dimension alias.

§Errors

Returns an error for a malformed name, expression, or range.

pub fn parameter( name: impl Into<String>, value_type: ValueTypeSyntax, value: Expr, range: TextRange, ) -> Result<ParameterDecl, AstConstructionError>

Construct a model-level typed Parameter declaration.

§Errors

Returns an error for a non-finite value or malformed source shape.

pub fn observable( name: impl Into<String>, value_type: ValueTypeSyntax, domain: Option<String>, value: Expr, range: TextRange, ) -> Result<ObservableDecl, AstConstructionError>

Construct a model-level typed Observable declaration.

§Errors

Returns an error for a non-finite value or malformed source shape.

pub fn coordinate( name: impl Into<String>, value_type: ValueTypeSyntax, domain: impl Into<String>, factor: Expr, range: TextRange, ) -> Result<NamedDefinitionDecl, AstConstructionError>

Construct an exact coordinate projection on a declared support. The selector is a factor name, optionally indexed by a literal axis.

§Errors

Rejects malformed names, ranges, or selectors that are not coordinate projections.

pub fn let_alias( name: impl Into<String>, value_type: Option<ValueTypeSyntax>, domain: Option<String>, activation: Option<String>, value: Expr, range: TextRange, ) -> Result<NamedDefinitionDecl, AstConstructionError>

Construct a reusable immutable local expression alias.

§Errors

Returns an error for malformed source expressions, names, or ranges.

§

impl SourceAstFactory

pub fn clock_requirement( name: impl Into<String>, range: TextRange, ) -> Result<ClockRequirementDecl, AstConstructionError>

Construct one borrowed exact-clock requirement without declaring a period.

§Errors

Rejects malformed identifiers and ranges.

pub fn component( visibility: VisibilitySyntax, name: impl Into<String>, signature: Vec<SignatureItem>, items: Vec<ComponentItem>, range: TextRange, ) -> Result<ComponentDecl, AstConstructionError>

Construct one reusable Component declaration.

§Errors

Returns an error for an invalid source identifier, member shape, or byte range.

pub fn with_formulation_gauge( component: ComponentDecl, form_name: &str, field: impl Into<String>, conditions: [(Expr, Expr); 2], ) -> Result<ComponentDecl, AstConstructionError>

Attach an explicit constant scalar gauge to one existing Formulation. The ordered equalities are its reference and load compatibility condition.

§Errors

Rejects malformed expressions, an unknown form, or a repeated gauge declaration.

pub fn component_with_form( visibility: VisibilitySyntax, name: impl Into<String>, signature: Vec<SignatureItem>, items: Vec<ComponentItem>, form: (String, Vec<String>, FormulationBinding), equalities: (Vec<(Expr, Expr)>, TextRange), range: TextRange, ) -> Result<ComponentDecl, AstConstructionError>

Construct a Component with one bound mathematical formulation after its members.

§Errors

Returns an error for an invalid member, identifier, expression, or byte range.

§

impl SourceAstFactory

pub fn with_enumeration(document: Document, declaration: EnumDecl) -> Document

Append a checked enum declaration to an owned compilation module.

pub fn model( visibility: VisibilitySyntax, name: impl Into<String>, signature: Vec<SignatureItem>, items: Vec<Item>, range: TextRange, ) -> Result<ModelDecl, AstConstructionError>

Construct one named flat model from already checked Item values.

§Errors

Returns an error for an invalid source identifier or byte range.

pub fn model_with_form( visibility: VisibilitySyntax, name: impl Into<String>, signature: Vec<SignatureItem>, items: Vec<Item>, form: (String, Vec<String>, FormulationBinding), equalities: (Vec<(Expr, Expr)>, TextRange), range: TextRange, ) -> Result<ModelDecl, AstConstructionError>

Construct a Model with one bound mathematical formulation after its members.

§Errors

Rejects invalid members, identifiers, expressions, or byte ranges.

pub fn with_model_signature( model: ModelDecl, signature: Vec<SignatureItem>, ) -> Result<ModelDecl, AstConstructionError>

Replace a Model signature while retaining its declarations and authored forms.

§Errors

Rejects an invalid signature.

pub fn with_import( document: Document, module: NamePath, alias: Option<String>, range: TextRange, ) -> Result<Document, AstConstructionError>

Add one explicit semantic module import to a source document.

§Errors

Returns an error for an invalid qualified module, alias, or source range.

pub fn document_with_dimensions( enumerations: Vec<EnumDecl>, dimensions: Vec<NamedDefinitionDecl>, connectors: Vec<ConnectorDecl>, components: Vec<ComponentDecl>, pure_operators: Vec<PureOperatorDecl>, models: Vec<ModelDecl>, ) -> Result<Document, AstConstructionError>

Close one compilation unit with an ordered structural-dimension prefix.

§Errors

Returns an error when the compilation unit contains no declaration.

pub fn document( enumerations: Vec<EnumDecl>, connectors: Vec<ConnectorDecl>, components: Vec<ComponentDecl>, models: Vec<ModelDecl>, ) -> Result<Document, AstConstructionError>

Close one nonempty compilation unit into a formatter-compatible document.

A declarations-only document is valid source syntax for a package library. Executable compilation still requires at least one Model.

§Errors

Returns an error when the compilation unit is empty.

pub fn document_with_pure_operators( enumerations: Vec<EnumDecl>, connectors: Vec<ConnectorDecl>, components: Vec<ComponentDecl>, pure_operators: Vec<PureOperatorDecl>, models: Vec<ModelDecl>, ) -> Result<Document, AstConstructionError>

Close one nonempty compilation unit including pure operators.

§Errors

Returns an error when the compilation unit is empty.

pub fn flat_document( models: Vec<ModelDecl>, ) -> Result<Document, AstConstructionError>

Close one or more flat models into a formatter-compatible document.

§Errors

Returns an error when models is empty, matching the source grammar.

§

impl SourceAstFactory

pub fn reduction( operation: ReductionOp, binder: FamilyBinderSyntax, value: Expr, range: TextRange, ) -> Result<Expr, AstConstructionError>

Construct a bounded scalar reduction with an explicit lexical binder.

§Errors

Rejects malformed binder names/ranges or excessive expression depth. The compiler checks index-set identity, cardinality, and scalar domain.

§

impl SourceAstFactory

pub fn property_requirement( name: impl Into<String>, contract: NamePath, range: TextRange, ) -> Result<ComponentPropertyDecl, AstConstructionError>

Construct a nominal property requirement in a shared signature.

§Errors

Rejects malformed names, paths, and ranges.

§

impl SourceAstFactory

pub fn condition( kind: RelationConditionKind, left: Expr, right: Expr, range: TextRange, ) -> Result<RelationCondition, AstConstructionError>

Construct a mathematical condition without disguising it as a Boolean or equality. Complementarity operands are explicit nonnegativity predicates; the compiler checks their literal zero, real order, units and exact supports.

§Errors

Rejects malformed expressions or ranges; mathematical admission remains compiler-owned.

§

impl SourceAstFactory

pub fn enumeration( visibility: VisibilitySyntax, name: impl Into<String>, tags: Vec<NamePath>, range: TextRange, ) -> Result<EnumDecl, AstConstructionError>

Construct a module enum with nonempty distinct tag tokens in authored order.

§Errors

Rejects malformed names/ranges, duplicate tags, or excessive cardinality.

pub fn case_arm_value( arm: &CaseArm, value: Expr, ) -> Result<CaseArm, AstConstructionError>

Replace a case arm value while preserving its checked pattern identity.

§Errors

Rejects malformed replacement expressions or arm ranges.

pub fn case_arm( pattern: NamePath, value: Expr, range: TextRange, ) -> Result<CaseArm, AstConstructionError>

Construct an explicit qualified-tag case arm without introducing a binder.

§Errors

Rejects nonqualified patterns, wildcards, malformed expressions or ranges.

§

impl SourceAstFactory

pub fn event( name: impl Into<String>, guard: Expr, direction: EventDirection, priority: i64, range: TextRange, ) -> Result<EventDecl, AstConstructionError>

Construct an event with inferred guard type, crossing direction and static priority.

§Errors

Rejects invalid names, ranges, and unbounded or malformed guard syntax. Scalar guard type and event scope are validated by the common compiler.

§

impl SourceAstFactory

pub fn law( name: impl Into<String>, domain: impl Into<String>, storage: Option<Expr>, flux: Expr, source: Expr, range: TextRange, ) -> Result<RelationDecl, AstConstructionError>

Construct a fixed-domain conservation Law with an outward physical flux.

Omit storage only for a steady balance. Supply source explicitly, using a typed zero where production is absent. Mathematical admission belongs to the compiler and kernel, independently of a numerical method.

§Errors

Rejects malformed names, term expressions, or source ranges.

§

impl SourceAstFactory

pub fn finite_space( visibility: VisibilitySyntax, name: impl Into<String>, labels: Vec<String>, range: TextRange, ) -> Result<NamedDefinitionDecl, AstConstructionError>

Construct a finite space with nonempty, distinct, ordered basis labels.

§Errors

Rejects invalid identifiers, repeated or absent labels, and malformed ranges.

pub fn finite_product( visibility: VisibilitySyntax, name: impl Into<String>, factors: [NamePath; 2], range: TextRange, ) -> Result<NamedDefinitionDecl, AstConstructionError>

Construct an alias for an ordered pair of primal atomic spaces.

§Errors

Rejects malformed names and ranges; factor identity is checked during binding.

pub fn index_set( name: impl Into<String>, extent: Expr, range: TextRange, ) -> Result<NamedDefinitionDecl, AstConstructionError>

Construct an index-set declaration, preserving its exact extent expression. Integer type, positivity, and structural resource bounds are elaboration checks.

§Errors

Rejects malformed names, expression trees, and byte ranges.

pub fn index_family_binder( binder: impl Into<String>, set: NamePath, range: TextRange, ) -> Result<FamilyBinderSyntax, AstConstructionError>

Construct a local binder over one nominal index-set name.

§Errors

Rejects malformed identifiers, name paths, and byte ranges.

§

impl SourceAstFactory

pub fn with_finite_space( document: Document, declaration: NamedDefinitionDecl, ) -> Result<Document, AstConstructionError>

Add one checked nominal space to an existing compilation unit.

pub fn bind_nominal_value_type( syntax: &mut ValueTypeSyntax, value: ValueType, ) -> Result<(), AstConstructionError>

Attach a checked lexical nominal binding while retaining authored syntax.

§Errors

Rejects a value type with a different nominal role or invalid source bounds.

§

impl SourceAstFactory

pub fn exact_integer( spelling: impl Into<String>, range: TextRange, ) -> Result<ExactIntegerSyntax, AstConstructionError>

Construct one exact integer token used by pure-operator syntax.

§Errors

Rejects non-decimal or u64-overflowing spelling and reversed ranges.

pub fn pure_operator_formal( name: impl Into<String>, value_class: PureValueClassSyntax, range: TextRange, ) -> Result<PureOperatorFormal, AstConstructionError>

Construct one ordered pure-operator formal.

§Errors

Returns an error for an invalid name, value class, or source range.

pub fn pure_operator( visibility: VisibilitySyntax, name: impl Into<String>, formals: Vec<PureOperatorFormal>, result: PureValueClassSyntax, body: Expr, range: TextRange, ) -> Result<PureOperatorDecl, AstConstructionError>

Construct one top-level pure operator declaration.

§Errors

Returns an error for an invalid name, an empty formal list, duplicate formal names, malformed exact syntax, or a reversed source range.

§

impl SourceAstFactory

pub fn elaborate_property_terms( document: &mut Document, contract_types: &BTreeMap<String, ValueTypeSyntax>, release_values: &BTreeMap<String, Expr>, property_targets: &BTreeMap<String, Vec<String>>, ) -> Result<(), AstConstructionError>

Materialize compiler-validated property requirements and exact release bindings.

§Errors

Rejects absent validated contract or release projections.

§

impl SourceAstFactory

pub fn with_property_contract( document: Option<Document>, name: String, value_type: ValueTypeSyntax, profile: (Vec<(String, ValueTypeSyntax)>, PropertyDerivatives, Option<NamePath>), range: TextRange, ) -> Result<Document, AstConstructionError>

Create or extend a compilation module with one checked property contract.

§Errors

Rejects malformed names, result syntax, or source ranges.

pub fn property_table( data: NamePath, axis: (String, Expr), value: (String, Expr), validity: [Expr; 2], range: TextRange, ) -> Result<PropertySourceSyntax, AstConstructionError>

Construct the fixed piecewise-affine table source profile.

§Errors

Rejects malformed references, column names, dimensions, or ranges.

pub fn with_property_release( document: Option<Document>, name: String, contract: NamePath, source: (PropertySourceSyntax, Expr, Expr), attribution: (NamePath, NamePath), profile: (Option<Expr>, Option<NamePath>), range: TextRange, ) -> Result<Document, AstConstructionError>

Append one property release with explicit scientific source metadata.

§Errors

Rejects malformed names, expressions, or ranges. The compiler owns nominal contract, dimensional, scaling, and value admission.

pub fn with_material_composition( document: Document, name: String, properties: Vec<(String, NamePath, TextRange)>, range: TextRange, ) -> Result<Document, AstConstructionError>

Append an explicit finite property composition.

§Errors

Rejects empty bindings, malformed names, paths, or source ranges.

§

impl SourceAstFactory

pub fn record_member( name: impl Into<String>, value_type: ValueTypeSyntax, range: TextRange, ) -> Result<RecordMemberDecl, AstConstructionError>

Construct one typed record member.

§Errors

Rejects invalid identifiers or source ranges.

pub fn record( visibility: VisibilitySyntax, name: impl Into<String>, members: Vec<RecordMemberDecl>, range: TextRange, ) -> Result<RecordDecl, AstConstructionError>

Construct a nonempty closed record with unique declaration-ordered members.

§Errors

Rejects invalid names/ranges, duplicate members, or excessive cardinality.

pub fn with_record(document: Document, declaration: RecordDecl) -> Document

Append a checked closed record declaration to an owned module.

§

impl SourceAstFactory

pub fn initial( equations: Vec<RelationCondition>, range: TextRange, ) -> Result<InitialDecl, AstConstructionError>

Construct simultaneous mathematical initialization conditions.

§Errors

Rejects empty conditions, malformed expressions, and invalid byte ranges.

pub fn equation( left: Expr, right: Expr, range: TextRange, ) -> Result<RelationCondition, AstConstructionError>

Construct an ordered equality without interpreting either side.

§Errors

Returns an error for a malformed expression or range.

pub fn relation( name: impl Into<String>, activation: ActivationSyntax, domain: Option<String>, equations: Vec<RelationCondition>, range: TextRange, ) -> Result<RelationDecl, AstConstructionError>

Construct an implicit Relation with at least one equality.

§Errors

Returns an error for an empty equation set or malformed source shape.

pub fn relation_family( relation: RelationDecl, binder: FamilyBinderSyntax, ) -> Result<RelationFamilyDecl, AstConstructionError>

Construct one Relation family over an exact finite set.

§Errors

Rejects malformed binders or equations. The compiler determines the set kind and checks support and activation restrictions.

§

impl SourceAstFactory

pub fn value_literal<'a>( value: &ValueLiteral, frame: Option<NamePath>, range: TextRange, resolve: impl FnMut(RawId) -> Option<NamePath>, resolve_enum: impl FnMut(RawId) -> Option<&'a EnumDef>, resolve_product: impl FnMut(FiniteBasis) -> Option<NamePath>, ) -> Result<Expr, AstConstructionError>

Project one complete coherent-SI value into the canonical source vocabulary.

§Errors

Rejects excessive type cardinality/nesting, a frame on an invariant value, or nonzero spatial components without an explicit frame.

§

impl SourceAstFactory

pub fn tensor_value( frame: NamePath, components: Expr, range: TextRange, ) -> Result<Expr, AstConstructionError>

Construct a spatial coefficient in the named support’s Cartesian frame. The frame reference does not give the coefficient spatial support.

§Errors

Rejects invalid names, ranges, or expressions exceeding source bounds.

§

impl SourceAstFactory

pub fn value_type( kind: ValueTypeSyntaxKind, range: TextRange, ) -> Result<ValueTypeSyntax, AstConstructionError>

Construct a bounded mathematical source type without parsing text.

§Errors

Rejects invalid scalar components, extents, nesting, expressions or ranges.

§

impl SourceAstFactory

pub const MAX_EXPRESSION_DEPTH: usize = 256

Maximum depth of one directly constructed expression tree.

pub const MAX_EXPRESSION_NODES: usize = 1_000_000

Maximum expression nodes admitted by one compilation module.

pub const MAX_CONTAINER_MEMBERS: usize = 65_536

Maximum declarations or equation members in one source container.

pub fn connector( visibility: VisibilitySyntax, name: impl Into<String>, syntax: ConnectorSyntax, range: TextRange, ) -> Result<ConnectorDecl, AstConstructionError>

Construct one nominal Connector declaration.

§Errors

Returns an error for malformed visibility-independent source shape, name, expression, or byte range.

pub fn connector_quantity( name: impl Into<String>, dimension: Expr, ) -> Result<ConnectorQuantitySyntax, AstConstructionError>

Construct one named field-physical Connector quantity.

§Errors

Returns an error for a malformed member name or dimension expression.

pub fn component_parameter( visibility: VisibilitySyntax, name: impl Into<String>, value_type: ValueTypeSyntax, default: Option<Expr>, range: TextRange, ) -> Result<ComponentParameterDecl, AstConstructionError>

Construct one component-local scalar Parameter.

§Errors

Returns an error for a malformed name, expression, or byte range.

pub fn component_port( visibility: VisibilitySyntax, name: impl Into<String>, syntax: PortSyntax, range: TextRange, ) -> Result<ComponentPortDecl, AstConstructionError>

Construct one component-local Port.

§Errors

Returns an error for malformed Port syntax, a name, or a byte range.

pub fn component_port_family( port: ComponentPortDecl, binder: FamilyBinderSyntax, ) -> Result<ComponentPortFamilyDecl, AstConstructionError>

Construct one field-physical Port family over a complete exterior.

§Errors

Returns an error unless the Port is field-physical, its support names the binder member, and both declarations are structurally valid.

pub fn boundary_family_binder( member: impl Into<String>, set: impl Into<String>, range: TextRange, ) -> Result<FamilyBinderSyntax, AstConstructionError>

Construct the restricted [member in complete_exterior] binder.

§Errors

Returns an error for malformed identifiers or a reversed range.

pub fn support_slot( visibility: VisibilitySyntax, name: impl Into<String>, syntax: SupportSlotSyntax, range: TextRange, ) -> Result<SupportSlotDecl, AstConstructionError>

Construct one component-local spatial-support slot.

§Errors

Returns an error for a malformed slot name, parent name, or byte range. Support-graph and visibility rules remain compiler responsibilities.

pub fn domain( name: impl Into<String>, syntax: DomainSyntax, range: TextRange, ) -> Result<DomainDecl, AstConstructionError>

Construct a Domain declaration.

§Errors

Returns an error for malformed source shape, names, expressions, or ranges. Geometric and dimensional meaning remains a lowering check.

pub fn field( name: impl Into<String>, domain: Option<String>, role: FieldRoleSyntax, spatial_regularity: SpatialRegularity, activation: ActivationSyntax, value_type: ValueTypeSyntax, range: TextRange, ) -> Result<FieldDecl, AstConstructionError>

Construct an owned unknown with independent role, support, and activation.

§Errors

Rejects malformed identifiers, complete type syntax, or byte ranges.

pub fn port( name: impl Into<String>, syntax: PortSyntax, range: TextRange, ) -> Result<PortDecl, AstConstructionError>

Construct a model-level Port declaration.

§Errors

Returns an error for malformed Port syntax, names, or ranges.

pub fn clock( name: impl Into<String>, period: Expr, phase: Expr, range: TextRange, ) -> Result<ClockDecl, AstConstructionError>

Construct an exact periodic Clock declaration.

Exact time admission, rational reduction, and nonzero-period checks remain semantic lowering checks, matching parsed source behavior.

§Errors

Returns an error for an invalid identifier, range, or expression tree.

pub fn connection( syntax: ConnectionSyntax, binder: Option<FamilyBinderSyntax>, ports: Vec<Expr>, range: TextRange, ) -> Result<ConnectionDecl, AstConstructionError>

Construct a signal or conserving Connection with at least two Ports.

§Errors

Returns an error for insufficient members or malformed paths/ranges.

pub fn boundary_connection( binder: Option<FamilyBinderSyntax>, ports: Vec<BoundaryPortReferenceSyntax>, range: TextRange, ) -> Result<BoundaryConnectionDecl, AstConstructionError>

Construct one conserving Connection with boundary-family Port references.

§Errors

Returns an error for fewer than two Ports, malformed references, or a declaration containing neither a family binder nor a selector.

pub fn spatial_periodic_boundary_connection( ports: Vec<BoundaryPortReferenceSyntax>, range: TextRange, ) -> Result<BoundaryConnectionDecl, AstConstructionError>

Construct one exact spatial-periodic pair in a closed Model.

§Errors

Returns an error unless there are exactly two boundary Ports.

pub fn boundary_port_reference( port: NamePath, selector: Option<BoundaryPortSelectorSyntax>, ) -> Result<BoundaryPortReferenceSyntax, AstConstructionError>

Construct one Port path with an optional exact boundary selector.

§Errors

Returns an error for a malformed path or selector.

pub fn boundary_port_selector( member: impl Into<String>, target: impl Into<String>, range: TextRange, ) -> Result<BoundaryPortSelectorSyntax, AstConstructionError>

Construct the closed [member = target] Port selector.

§Errors

Returns an error for malformed identifiers or a reversed range.

pub fn instance( name: impl Into<String>, definition: NamePath, family: Option<FamilyBinderSyntax>, bindings: Vec<NamedBindingDecl>, range: TextRange, ) -> Result<InstanceDecl, AstConstructionError>

Construct one occurrence with category-free named bindings.

§Errors

Rejects malformed names, expressions, and ranges.

pub fn named_binding( name: impl Into<String>, value: Expr, range: TextRange, ) -> Result<NamedBindingDecl, AstConstructionError>

Construct one target-directed named binding.

§Errors

Rejects malformed names, expressions, and ranges.

pub fn expression( kind: ExprKind, range: TextRange, ) -> Result<Expr, AstConstructionError>

Construct one source expression from an owned recursive expression kind.

§Errors

Returns an error for malformed names, non-finite literals, child expressions, or byte ranges.

Trait Implementations§

§

impl Clone for SourceAstFactory

§

fn clone(&self) -> SourceAstFactory

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
§

impl Debug for SourceAstFactory

§

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

Formats the value using the given formatter. Read more
§

impl Default for SourceAstFactory

§

fn default() -> SourceAstFactory

Returns the “default value” for a type. Read more
§

impl Copy for SourceAstFactory

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

§

type Err = NoError

The error type produced by a failed conversion.
§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

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, Dst> ConvAsUtil<Dst> for T

§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
§

impl<T> ConvUtil for T

§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
§

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

§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

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
§

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> Same for T

Source§

type Output = T

Should always be Self
§

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.
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<Src> TryFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<Src> ValueFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.
§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,