Skip to main content

AnalysisPolicy

Struct AnalysisPolicy 

Source
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: AssemblyChoice

Which arrangement of the contents to analyse.

§model: ModelChoice

Which model.

§altloc: AltlocPolicy

How alternate conformations resolve.

§identifiers: Namespace

Which identifier namespace an unqualified selector means.

§missing_atoms: MissingPolicy

What to do about atoms that were not modelled.

§hydrogens: HydrogenPolicy

How hydrogens enter.

§atom_equivalence: EquivalencePolicy

How atoms are matched between structures.

§symmetry: SymmetryPolicy

Whether symmetry copies participate.

§alignment: AlignmentPolicy

How structures are put into correspondence.

§precision: Precision

The width accumulation runs at.

§periodic: PeriodicPolicy

How periodic boundaries are handled.

§vdw_radii: RadiiSet

Which radii set.

§contact_def: ContactDefinition

What counts as a contact.

§float_tolerance: Tolerance

How close two floating-point values must be to count as equal.

Implementations§

Source§

impl AnalysisPolicy

Source

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) or BiologicalAssembly;
  • crystal contacts are crystallographic copies within a radius, so they go with None (the radius alone names them) or Crystallographic, 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

Source

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.

Source

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.

Source

pub fn with_identifiers(self, namespace: Namespace) -> AnalysisPolicy

Returns this policy with a different identifier namespace.

Source

pub fn with_altloc(self, altloc: AltlocPolicy) -> AnalysisPolicy

Returns this policy with a different alternate-conformation rule.

Source

pub fn with_model(self, model: ModelChoice) -> AnalysisPolicy

Returns this policy with a different model choice.

Source

pub fn with_assembly(self, assembly: AssemblyChoice) -> AnalysisPolicy

Returns this policy with a different assembly choice.

Source

pub fn with_missing_atoms(self, missing: MissingPolicy) -> AnalysisPolicy

Returns this policy with a different rule for unmodelled atoms.

Trait Implementations§

Source§

impl Clone for AnalysisPolicy

Source§

fn clone(&self) -> AnalysisPolicy

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 AnalysisPolicy

Source§

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

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

impl Default for AnalysisPolicy

Source§

fn default() -> AnalysisPolicy

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

impl Display for AnalysisPolicy

Source§

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

Writes the policy as one field per line, which is what the command line prints and what a written record contains.

Source§

impl PartialEq for AnalysisPolicy

Source§

fn eq(&self, other: &AnalysisPolicy) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AnalysisPolicy

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
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.