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
impl SourceAstFactory
pub fn document(
connectors: Vec<ConnectorDecl>,
components: Vec<ComponentDecl>,
models: Vec<ModelDecl>,
) -> Result<Document, AstConstructionError>
pub fn document( 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(
connectors: Vec<ConnectorDecl>,
components: Vec<ComponentDecl>,
pure_operators: Vec<PureOperatorDecl>,
models: Vec<ModelDecl>,
) -> Result<Document, AstConstructionError>
pub fn document_with_pure_operators( connectors: Vec<ConnectorDecl>, components: Vec<ComponentDecl>, pure_operators: Vec<PureOperatorDecl>, models: Vec<ModelDecl>, ) -> Result<Document, AstConstructionError>
Close one nonempty compilation unit including pure operators.
The three-argument Self::document constructor remains the compact
compatibility entry point for clients that do not author operators.
§Errors
Returns an error when the compilation unit is empty.
pub fn flat_document(
models: Vec<ModelDecl>,
) -> Result<Document, AstConstructionError>
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.
pub fn exact_integer(
spelling: impl Into<String>,
range: TextRange,
) -> Result<ExactIntegerSyntax, AstConstructionError>
pub fn exact_integer( spelling: impl Into<String>, range: TextRange, ) -> Result<ExactIntegerSyntax, AstConstructionError>
Construct one exact integer token used by pure-operator syntax.
§Errors
Returns an error when spelling is not an unsigned decimal integer,
does not fit in u64, or the source range is reversed.
pub fn pure_operator_formal(
name: impl Into<String>,
value_class: PureValueClassSyntax,
range: TextRange,
) -> Result<PureOperatorFormal, AstConstructionError>
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_expression(
kind: PureOperatorExprKind,
range: TextRange,
) -> Result<PureOperatorExpr, AstConstructionError>
pub fn pure_operator_expression( kind: PureOperatorExprKind, range: TextRange, ) -> Result<PureOperatorExpr, AstConstructionError>
Construct one bounded pure-operator expression.
§Errors
Returns an error for malformed exact syntax or a reversed source range.
pub fn pure_operator(
visibility: VisibilitySyntax,
name: impl Into<String>,
formals: Vec<PureOperatorFormal>,
result: PureValueClassSyntax,
body: PureOperatorExpr,
range: TextRange,
) -> Result<PureOperatorDecl, AstConstructionError>
pub fn pure_operator( visibility: VisibilitySyntax, name: impl Into<String>, formals: Vec<PureOperatorFormal>, result: PureValueClassSyntax, body: PureOperatorExpr, 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.
pub fn connector(
visibility: VisibilitySyntax,
name: impl Into<String>,
syntax: ConnectorSyntax,
range: TextRange,
) -> Result<ConnectorDecl, AstConstructionError>
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>
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(
visibility: VisibilitySyntax,
name: impl Into<String>,
items: Vec<ComponentItem>,
range: TextRange,
) -> Result<ComponentDecl, AstConstructionError>
pub fn component( visibility: VisibilitySyntax, name: impl Into<String>, 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. Name resolution and component semantics remain compiler responsibilities.
pub fn component_parameter(
visibility: VisibilitySyntax,
name: impl Into<String>,
dimension: Expr,
default: Option<Expr>,
range: TextRange,
) -> Result<ComponentParameterDecl, AstConstructionError>
pub fn component_parameter( visibility: VisibilitySyntax, name: impl Into<String>, dimension: Expr, 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>
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: BoundaryFamilyBinderSyntax,
) -> Result<ComponentPortFamilyDecl, AstConstructionError>
pub fn component_port_family( port: ComponentPortDecl, binder: BoundaryFamilyBinderSyntax, ) -> 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<BoundaryFamilyBinderSyntax, AstConstructionError>
pub fn boundary_family_binder( member: impl Into<String>, set: impl Into<String>, range: TextRange, ) -> Result<BoundaryFamilyBinderSyntax, 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>
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 field_slot(
name: impl Into<String>,
support: impl Into<String>,
dimension: Expr,
shape: Option<ValueShapeSyntax>,
range: TextRange,
) -> Result<FieldSlotDecl, AstConstructionError>
pub fn field_slot( name: impl Into<String>, support: impl Into<String>, dimension: Expr, shape: Option<ValueShapeSyntax>, range: TextRange, ) -> Result<FieldSlotDecl, AstConstructionError>
Construct one public, required continuum Field slot.
§Errors
Returns an error for malformed names, dimensions, value shapes, or byte ranges. Exact support and Field compatibility remain compiler checks.
pub fn model(
name: impl Into<String>,
items: Vec<Item>,
range: TextRange,
) -> Result<ModelDecl, AstConstructionError>
pub fn model( name: impl Into<String>, 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 domain(
name: impl Into<String>,
syntax: DomainSyntax,
range: TextRange,
) -> Result<DomainDecl, AstConstructionError>
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 representation(
name: impl Into<String>,
syntax: RepresentationSyntax,
range: TextRange,
) -> Result<RepresentationDecl, AstConstructionError>
pub fn representation( name: impl Into<String>, syntax: RepresentationSyntax, range: TextRange, ) -> Result<RepresentationDecl, AstConstructionError>
Construct a Representation declaration.
§Errors
Returns an error for an invalid source identifier or byte range.
pub fn field(
name: impl Into<String>,
domain: Option<String>,
representation: Option<String>,
dimension: Expr,
initial: f64,
range: TextRange,
) -> Result<FieldDecl, AstConstructionError>
pub fn field( name: impl Into<String>, domain: Option<String>, representation: Option<String>, dimension: Expr, initial: f64, range: TextRange, ) -> Result<FieldDecl, AstConstructionError>
Construct a scalar or spatial Field declaration.
domain and representation must either both be present or both be
absent, as required by the source grammar.
§Errors
Returns an error for an incomplete spatial scope, non-finite initial value, malformed expression, identifier, or byte range.
pub fn field_with_shape(
name: impl Into<String>,
domain: Option<String>,
representation: Option<String>,
shape: Option<ValueShapeSyntax>,
dimension: Expr,
initial: Option<f64>,
range: TextRange,
) -> Result<FieldDecl, AstConstructionError>
pub fn field_with_shape( name: impl Into<String>, domain: Option<String>, representation: Option<String>, shape: Option<ValueShapeSyntax>, dimension: Expr, initial: Option<f64>, range: TextRange, ) -> Result<FieldDecl, AstConstructionError>
Construct a scalar or shaped Field declaration.
shape = None preserves the legacy scalar spelling. An explicit shape
is retained in source form for context-dependent lowering.
§Errors
Returns the same structural errors as Self::field, plus malformed
exact shape extents.
pub fn parameter(
name: impl Into<String>,
dimension: Expr,
initial: f64,
range: TextRange,
) -> Result<ParameterDecl, AstConstructionError>
pub fn parameter( name: impl Into<String>, dimension: Expr, initial: f64, range: TextRange, ) -> Result<ParameterDecl, AstConstructionError>
Construct a model-level scalar Parameter declaration.
§Errors
Returns an error for a non-finite value or malformed source shape.
pub fn port(
name: impl Into<String>,
syntax: PortSyntax,
range: TextRange,
) -> Result<PortDecl, AstConstructionError>
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: RationalSyntax,
phase: RationalSyntax,
range: TextRange,
) -> Result<ClockDecl, AstConstructionError>
pub fn clock( name: impl Into<String>, period: RationalSyntax, phase: RationalSyntax, range: TextRange, ) -> Result<ClockDecl, AstConstructionError>
Construct an exact periodic Clock declaration.
Rational reduction and nonzero-period checks remain semantic lowering checks, matching parsed source behavior.
§Errors
Returns an error for an invalid source identifier or byte range.
pub fn relation(
name: impl Into<String>,
activation: ActivationSyntax,
domain: Option<String>,
residuals: Vec<Expr>,
range: TextRange,
) -> Result<RelationDecl, AstConstructionError>
pub fn relation( name: impl Into<String>, activation: ActivationSyntax, domain: Option<String>, residuals: Vec<Expr>, range: TextRange, ) -> Result<RelationDecl, AstConstructionError>
Construct an implicit Relation with at least one residual.
§Errors
Returns an error for an empty residual set or malformed source shape.
pub fn relation_family(
relation: RelationDecl,
binder: BoundaryFamilyBinderSyntax,
) -> Result<RelationFamilyDecl, AstConstructionError>
pub fn relation_family( relation: RelationDecl, binder: BoundaryFamilyBinderSyntax, ) -> Result<RelationFamilyDecl, AstConstructionError>
Construct one continuous Relation family over a complete exterior.
§Errors
Returns an error unless the Relation is continuous, is attached to the binder member, and both declarations are structurally valid.
pub fn connection(
syntax: ConnectionSyntax,
ports: Vec<NamePath>,
range: TextRange,
) -> Result<ConnectionDecl, AstConstructionError>
pub fn connection( syntax: ConnectionSyntax, ports: Vec<NamePath>, 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<BoundaryFamilyBinderSyntax>,
ports: Vec<BoundaryPortReferenceSyntax>,
range: TextRange,
) -> Result<BoundaryConnectionDecl, AstConstructionError>
pub fn boundary_connection( binder: Option<BoundaryFamilyBinderSyntax>, 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>
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>
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>
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 boundary(
ports: Vec<NamePath>,
range: TextRange,
) -> Result<BoundaryDecl, AstConstructionError>
pub fn boundary( ports: Vec<NamePath>, range: TextRange, ) -> Result<BoundaryDecl, AstConstructionError>
Construct a nonempty public model boundary.
§Errors
Returns an error for an empty boundary or malformed paths/ranges.
pub fn instance(
name: impl Into<String>,
definition: NamePath,
bindings: Vec<ParameterBindingDecl>,
range: TextRange,
) -> Result<InstanceDecl, AstConstructionError>
pub fn instance( name: impl Into<String>, definition: NamePath, bindings: Vec<ParameterBindingDecl>, range: TextRange, ) -> Result<InstanceDecl, AstConstructionError>
Construct one compile-time component instance.
§Errors
Returns an error for malformed names, bindings, or ranges.
pub fn instance_with_support_bindings(
name: impl Into<String>,
definition: NamePath,
bindings: Vec<ParameterBindingDecl>,
support_bindings: Vec<SupportBindingDecl>,
range: TextRange,
) -> Result<InstanceDecl, AstConstructionError>
pub fn instance_with_support_bindings( name: impl Into<String>, definition: NamePath, bindings: Vec<ParameterBindingDecl>, support_bindings: Vec<SupportBindingDecl>, range: TextRange, ) -> Result<InstanceDecl, AstConstructionError>
Construct one compile-time component instance with spatial supports.
§Errors
Returns an error for malformed names, either binding family, or ranges.
pub fn instance_with_slot_bindings(
name: impl Into<String>,
definition: NamePath,
bindings: Vec<ParameterBindingDecl>,
support_bindings: Vec<SupportBindingDecl>,
field_bindings: Vec<FieldBindingDecl>,
range: TextRange,
) -> Result<InstanceDecl, AstConstructionError>
pub fn instance_with_slot_bindings( name: impl Into<String>, definition: NamePath, bindings: Vec<ParameterBindingDecl>, support_bindings: Vec<SupportBindingDecl>, field_bindings: Vec<FieldBindingDecl>, range: TextRange, ) -> Result<InstanceDecl, AstConstructionError>
Construct one compile-time component instance with occurrence-bound support and Field slots.
§Errors
Returns an error for malformed names, any binding family, or ranges.
pub fn instance_with_boundary_set_bindings(
name: impl Into<String>,
definition: NamePath,
bindings: Vec<ParameterBindingDecl>,
support_bindings: Vec<SupportBindingDecl>,
boundary_set_bindings: Vec<BoundarySetBindingDecl>,
field_bindings: Vec<FieldBindingDecl>,
range: TextRange,
) -> Result<InstanceDecl, AstConstructionError>
pub fn instance_with_boundary_set_bindings( name: impl Into<String>, definition: NamePath, bindings: Vec<ParameterBindingDecl>, support_bindings: Vec<SupportBindingDecl>, boundary_set_bindings: Vec<BoundarySetBindingDecl>, field_bindings: Vec<FieldBindingDecl>, range: TextRange, ) -> Result<InstanceDecl, AstConstructionError>
Construct one compile-time component instance with every closed binding family, including finite complete-exterior bindings.
§Errors
Returns an error for malformed names, any binding family, or ranges.
pub fn parameter_binding(
parameter: impl Into<String>,
value: Expr,
range: TextRange,
) -> Result<ParameterBindingDecl, AstConstructionError>
pub fn parameter_binding( parameter: impl Into<String>, value: Expr, range: TextRange, ) -> Result<ParameterBindingDecl, AstConstructionError>
Construct one named component Parameter binding.
§Errors
Returns an error for a malformed target, expression, or byte range.
pub fn support_binding(
slot: impl Into<String>,
target: impl Into<String>,
range: TextRange,
) -> Result<SupportBindingDecl, AstConstructionError>
pub fn support_binding( slot: impl Into<String>, target: impl Into<String>, range: TextRange, ) -> Result<SupportBindingDecl, AstConstructionError>
Construct one named component spatial-support binding.
§Errors
Returns an error for a malformed slot, target, or byte range.
pub fn boundary_set_binding(
slot: impl Into<String>,
members: Vec<BoundarySetMemberSyntax>,
range: TextRange,
) -> Result<BoundarySetBindingDecl, AstConstructionError>
pub fn boundary_set_binding( slot: impl Into<String>, members: Vec<BoundarySetMemberSyntax>, range: TextRange, ) -> Result<BoundarySetBindingDecl, AstConstructionError>
Construct one finite complete-exterior support binding.
Empty member lists remain syntactically representable so semantic validation can issue the same contextual diagnostic as parsed source.
§Errors
Returns an error for malformed members, a slot, or a byte range.
pub fn boundary_set_member(
target: impl Into<String>,
range: TextRange,
) -> Result<BoundarySetMemberSyntax, AstConstructionError>
pub fn boundary_set_member( target: impl Into<String>, range: TextRange, ) -> Result<BoundarySetMemberSyntax, AstConstructionError>
Construct one named member of a finite complete-exterior binding.
§Errors
Returns an error for a malformed target or byte range.
pub fn field_binding(
slot: impl Into<String>,
target: impl Into<String>,
range: TextRange,
) -> Result<FieldBindingDecl, AstConstructionError>
pub fn field_binding( slot: impl Into<String>, target: impl Into<String>, range: TextRange, ) -> Result<FieldBindingDecl, AstConstructionError>
Construct one named occurrence-bound Field binding.
§Errors
Returns an error for a malformed slot, target, or byte range.
pub fn expression(
kind: ExprKind,
range: TextRange,
) -> Result<Expr, AstConstructionError>
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.
pub const fn rational(numerator: u64, denominator: u64) -> RationalSyntax
pub const fn rational(numerator: u64, denominator: u64) -> RationalSyntax
Construct unreduced rational source syntax.
Trait Implementations§
§impl Clone for SourceAstFactory
impl Clone for SourceAstFactory
§impl Debug for SourceAstFactory
impl Debug for SourceAstFactory
§impl Default for SourceAstFactory
impl Default for SourceAstFactory
§fn default() -> SourceAstFactory
fn default() -> SourceAstFactory
impl Copy for SourceAstFactory
Auto Trait Implementations§
impl Freeze for SourceAstFactory
impl RefUnwindSafe for SourceAstFactory
impl Send for SourceAstFactory
impl Sync for SourceAstFactory
impl Unpin for SourceAstFactory
impl UnsafeUnpin for SourceAstFactory
impl UnwindSafe for SourceAstFactory
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Source§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
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,
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
§fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
§fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> From<T> for T
impl<T> From<T> for T
Source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
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
impl<T> Pointable for T
Source§impl<T> Same for T
impl<T> Same for T
§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.