pub struct RietveldPhase { /* private fields */ }Expand description
One owned monochromatic structural phase and its sample-physics inputs.
Implementations§
Source§impl RietveldPhase
impl RietveldPhase
Sourcepub fn new(
phase_id: RecordId,
name: impl Into<String>,
definition: StructuralPhaseDefinition,
contributions: OwnedCwContributions,
) -> Result<Self, RietveldError>
pub fn new( phase_id: RecordId, name: impl Into<String>, definition: StructuralPhaseDefinition, contributions: OwnedCwContributions, ) -> Result<Self, RietveldError>
Validate and own one built-in structural phase.
§Errors
Returns RietveldError for an empty name, invalid definition, or a
contribution batch with the wrong reflection count.
Sourcepub fn new_with_site_ids(
phase_id: RecordId,
name: impl Into<String>,
site_ids: Vec<RecordId>,
definition: StructuralPhaseDefinition,
contributions: OwnedCwContributions,
) -> Result<Self, RietveldError>
pub fn new_with_site_ids( phase_id: RecordId, name: impl Into<String>, site_ids: Vec<RecordId>, definition: StructuralPhaseDefinition, contributions: OwnedCwContributions, ) -> Result<Self, RietveldError>
Validate and own one phase with explicit stable asymmetric-site IDs.
§Errors
Returns RietveldError when site IDs are missing or duplicated, or
when another phase invariant is invalid.
Sourcepub fn from_lattice_domain(
phase_id: RecordId,
name: impl Into<String>,
site_ids: Vec<RecordId>,
definition: StructuralPhaseDefinition,
reflection_domain: LatticeReflectionDomain,
) -> Result<Self, RietveldError>
pub fn from_lattice_domain( phase_id: RecordId, name: impl Into<String>, site_ids: Vec<RecordId>, definition: StructuralPhaseDefinition, reflection_domain: LatticeReflectionDomain, ) -> Result<Self, RietveldError>
Generate a structural phase from one bounded reflection-domain contract.
Reflection arrays are regenerated from the definition’s cell and start with neutral sample-physics contributions. Subsequent accepted cell changes transfer contribution arrays by stable reflection ID.
§Errors
Returns RietveldError for an invalid domain, definition, or phase.
Sourcepub fn validate(&self) -> Result<(), RietveldError>
pub fn validate(&self) -> Result<(), RietveldError>
Revalidate adapter-decoded phase identity, structure, and topology.
§Errors
Returns RietveldError for invalid phase state.
Sourcepub fn site_ids(&self) -> &[RecordId]
pub fn site_ids(&self) -> &[RecordId]
Borrow stable asymmetric-site IDs in structural-array order.
Sourcepub fn reflection_ids(&self) -> &[String]
pub fn reflection_ids(&self) -> &[String]
Borrow stable reflection-family IDs in calculation order.
Sourcepub const fn definition(&self) -> &StructuralPhaseDefinition
pub const fn definition(&self) -> &StructuralPhaseDefinition
Borrow the complete structural definition.
Sourcepub const fn contributions(&self) -> &OwnedCwContributions
pub const fn contributions(&self) -> &OwnedCwContributions
Borrow the owned sample-physics contribution batch.
Sourcepub const fn sample_physics(&self) -> Option<&RietveldSamplePhysicsModel>
pub const fn sample_physics(&self) -> Option<&RietveldSamplePhysicsModel>
Borrow the optional built-in sample-physics model record.
Sourcepub fn with_sample_physics(self, model: RietveldSamplePhysicsModel) -> Self
pub fn with_sample_physics(self, model: RietveldSamplePhysicsModel) -> Self
Attach one built-in sample-physics model to this phase.
The static contribution batch is retained only as the fixed-provider fallback and is not composed with the built-in model.
Sourcepub fn without_sample_physics(self) -> Self
pub fn without_sample_physics(self) -> Self
Remove the built-in sample-physics model without changing the phase’s structure, reflection topology, or fixed contribution fallback.
Sourcepub fn with_contributions(
&self,
contributions: OwnedCwContributions,
) -> Result<Self, RietveldError>
pub fn with_contributions( &self, contributions: OwnedCwContributions, ) -> Result<Self, RietveldError>
Replace sample-physics contributions without changing phase topology.
§Errors
Returns RietveldError when the contribution reflection count does
not match the current stable reflection list.
Sourcepub const fn reflection_domain(&self) -> Option<&LatticeReflectionDomain>
pub const fn reflection_domain(&self) -> Option<&LatticeReflectionDomain>
Borrow the guarded reflection domain for a dynamic phase.
Sourcepub fn regenerate_lattice_at_cell(
&self,
cell: UnitCell,
) -> Result<(Self, RietveldTopologyChange), RietveldError>
pub fn regenerate_lattice_at_cell( &self, cell: UnitCell, ) -> Result<(Self, RietveldTopologyChange), RietveldError>
Regenerate a dynamic phase at another accepted bounded cell.
Existing sample-physics values and parameter derivatives transfer by stable reflection ID. New reflection families receive neutral values.
§Errors
Returns RietveldError for a fixed phase, an out-of-domain cell, or
invalid transferred contributions.
Trait Implementations§
Source§impl Clone for RietveldPhase
impl Clone for RietveldPhase
Source§fn clone(&self) -> RietveldPhase
fn clone(&self) -> RietveldPhase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RietveldPhase
impl Debug for RietveldPhase
Source§impl PartialEq for RietveldPhase
impl PartialEq for RietveldPhase
impl StructuralPartialEq for RietveldPhase
Auto Trait Implementations§
impl Freeze for RietveldPhase
impl RefUnwindSafe for RietveldPhase
impl Send for RietveldPhase
impl Sync for RietveldPhase
impl Unpin for RietveldPhase
impl UnsafeUnpin for RietveldPhase
impl UnwindSafe for RietveldPhase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> 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> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.