pub struct AnalysisPolicy {Show 14 fields
pub assembly: AssemblyChoice,
pub model: ModelChoice,
pub altloc: AltlocPolicy,
pub identifiers: Namespace,
pub missing_atoms: MissingPolicy,
pub hydrogens: HydrogenPolicy,
pub atom_equivalence: EquivalencePolicy,
pub symmetry: SymmetryPolicy,
pub alignment: AlignmentPolicy,
pub precision: Precision,
pub periodic: PeriodicPolicy,
pub vdw_radii: RadiiSet,
pub contact_def: ContactDefinition,
pub float_tolerance: Tolerance,
}Expand description
Every semantic decision an analysis depends on.
§Examples
use molframe_core::contract::{AnalysisPolicy, Namespace, ProfileId};
let policy = AnalysisPolicy::default();
assert_eq!(policy.profile(), Some(ProfileId::DEFAULT));
assert_eq!(policy.identifiers, Namespace::Auth);
let explicit = AnalysisPolicy::default().with_identifiers(Namespace::Explicit);
assert_eq!(explicit.profile(), None, "no longer the named profile");
assert_ne!(explicit.fingerprint(), policy.fingerprint());Fields§
§assembly: AssemblyChoiceWhich arrangement of the contents to analyse.
model: ModelChoiceWhich model.
altloc: AltlocPolicyHow alternate conformations resolve.
identifiers: NamespaceWhich identifier namespace an unqualified selector means.
missing_atoms: MissingPolicyWhat to do about atoms that were not modelled.
hydrogens: HydrogenPolicyHow hydrogens enter.
atom_equivalence: EquivalencePolicyHow atoms are matched between structures.
symmetry: SymmetryPolicyWhether symmetry copies participate.
alignment: AlignmentPolicyHow structures are put into correspondence.
precision: PrecisionThe width accumulation runs at.
periodic: PeriodicPolicyHow periodic boundaries are handled.
vdw_radii: RadiiSetWhich radii set.
contact_def: ContactDefinitionWhat counts as a contact.
float_tolerance: ToleranceHow close two floating-point values must be to count as equal.
Implementations§
Source§impl AnalysisPolicy
impl AnalysisPolicy
Sourcepub fn check_consistency(&self) -> Result<(), Diagnostic>
pub fn check_consistency(&self) -> Result<(), Diagnostic>
Checks that the decisions describe one runnable system.
The rules, each a statement about what the copies are:
- the asymmetric unit has no copies, so it goes with
SymmetryPolicy::None; - a biological assembly’s copies are the assembly’s, so it goes with
None(the assembly alone) orBiologicalAssembly; - crystal contacts are crystallographic copies within a radius, so they go
with
None(the radius alone names them) orCrystallographic, and the radius must be positive and finite.
§Errors
Returns Code::E6004 naming the two contradictory fields, or
Code::E6016 for a crystal radius that is not a positive finite number.
Source§impl AnalysisPolicy
impl AnalysisPolicy
Sourcepub fn profile(&self) -> Option<ProfileId>
pub fn profile(&self) -> Option<ProfileId>
The named profile this policy is, if it has not been altered.
A result recording a profile name is reproducible by someone who has only the name. A result recording “the defaults” is not.
Sourcepub fn fingerprint(&self) -> Fingerprint
pub fn fingerprint(&self) -> Fingerprint
A stable fingerprint of every field.
Two policies that differ anywhere differ here, and the same policy always fingerprints the same way, within and across runs. It is a fingerprint for telling policies apart, not a cryptographic commitment.
Sourcepub fn with_identifiers(self, namespace: Namespace) -> Self
pub fn with_identifiers(self, namespace: Namespace) -> Self
Returns this policy with a different identifier namespace.
Sourcepub fn with_altloc(self, altloc: AltlocPolicy) -> Self
pub fn with_altloc(self, altloc: AltlocPolicy) -> Self
Returns this policy with a different alternate-conformation rule.
Sourcepub fn with_model(self, model: ModelChoice) -> Self
pub fn with_model(self, model: ModelChoice) -> Self
Returns this policy with a different model choice.
Sourcepub fn with_assembly(self, assembly: AssemblyChoice) -> Self
pub fn with_assembly(self, assembly: AssemblyChoice) -> Self
Returns this policy with a different assembly choice.
Sourcepub fn with_missing_atoms(self, missing: MissingPolicy) -> Self
pub fn with_missing_atoms(self, missing: MissingPolicy) -> Self
Returns this policy with a different rule for unmodelled atoms.
Trait Implementations§
Source§impl Clone for AnalysisPolicy
impl Clone for AnalysisPolicy
Source§impl Debug for AnalysisPolicy
impl Debug for AnalysisPolicy
Source§impl Default for AnalysisPolicy
impl Default for AnalysisPolicy
Source§impl Display for AnalysisPolicy
impl Display for AnalysisPolicy
Source§impl PartialEq for AnalysisPolicy
impl PartialEq for AnalysisPolicy
impl StructuralPartialEq for AnalysisPolicy
Auto Trait Implementations§
impl Freeze for AnalysisPolicy
impl RefUnwindSafe for AnalysisPolicy
impl Send for AnalysisPolicy
impl Sync for AnalysisPolicy
impl Unpin for AnalysisPolicy
impl UnsafeUnpin for AnalysisPolicy
impl UnwindSafe for AnalysisPolicy
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 more