pub struct ReadOptions {
pub format: Format,
pub mode: ParseMode,
pub only_first_model: bool,
pub only_atomic_coords: bool,
pub perception: Perception,
pub discard_hydrogens: bool,
pub missing_element_policy: MissingElementPolicy,
pub occupancy_policy: OccupancyPolicy,
pub ambiguous_residue_boundary_policy: AmbiguousResidueBoundaryPolicy,
pub limits: Limits,
pub categories: CategoryFilter,
pub input_digest: InputDigest,
}Expand description
What a read should and should not bother doing.
Fields§
§format: FormatWhich format, or automatic detection.
mode: ParseModeHow much irregularity to tolerate.
only_first_model: boolRead only the first model.
only_atomic_coords: boolRead coordinates and skip everything else.
perception: PerceptionSkip the perception pass that follows a read: inferred bonds, standard component annotation and secondary-structure assignment. The parse and everything the file itself records are unaffected; only what a reader would otherwise compute from the coordinates is left out.
discard_hydrogens: boolDrop hydrogens while reading.
missing_element_policy: MissingElementPolicyWhat to do when a row does not declare a valid element.
occupancy_policy: OccupancyPolicyWhat to do when a recorded occupancy lies outside zero to one.
ambiguous_residue_boundary_policy: AmbiguousResidueBoundaryPolicyWhat to do when mmCIF residue identifiers do not define a boundary.
limits: LimitsCeilings that apply while reading.
categories: CategoryFilterWhich optional categories or records to read.
input_digest: InputDigestWhether to record the SHA-256 of the bytes parsed in the structure’s entry metadata; only a result certified as computed from exactly these bytes needs it.
Implementations§
Source§impl ReadOptions
impl ReadOptions
Sourcepub fn new() -> ReadOptions
pub fn new() -> ReadOptions
Options that read everything, tolerating what the archive contains.
Sourcepub const fn format(self, format: Format) -> ReadOptions
pub const fn format(self, format: Format) -> ReadOptions
Sets the format.
Sourcepub const fn mode(self, mode: ParseMode) -> ReadOptions
pub const fn mode(self, mode: ParseMode) -> ReadOptions
Sets how much irregularity to tolerate.
Sourcepub const fn only_first_model(self, only: bool) -> ReadOptions
pub const fn only_first_model(self, only: bool) -> ReadOptions
Reads only the first model.
Sourcepub const fn only_atomic_coords(self, only: bool) -> ReadOptions
pub const fn only_atomic_coords(self, only: bool) -> ReadOptions
Reads coordinates and skips everything else.
Sourcepub const fn perceive(self, perceive: bool) -> ReadOptions
pub const fn perceive(self, perceive: bool) -> ReadOptions
Chooses whether the perception pass runs after the parse (it does by default).
Passing false returns the structure as the file states it: file bonds and
deposited secondary structure are kept, nothing is inferred from geometry.
Sourcepub const fn missing_element_policy(
self,
policy: MissingElementPolicy,
) -> ReadOptions
pub const fn missing_element_policy( self, policy: MissingElementPolicy, ) -> ReadOptions
Selects an explicit policy for missing or invalid element fields.
Sourcepub const fn occupancy_policy(self, policy: OccupancyPolicy) -> ReadOptions
pub const fn occupancy_policy(self, policy: OccupancyPolicy) -> ReadOptions
Selects the policy for occupancies outside zero to one.
Sourcepub const fn ambiguous_residue_boundary_policy(
self,
policy: AmbiguousResidueBoundaryPolicy,
) -> ReadOptions
pub const fn ambiguous_residue_boundary_policy( self, policy: AmbiguousResidueBoundaryPolicy, ) -> ReadOptions
Selects an explicit policy for ambiguous mmCIF residue boundaries.
Sourcepub const fn discard_hydrogens(self, discard: bool) -> ReadOptions
pub const fn discard_hydrogens(self, discard: bool) -> ReadOptions
Drops hydrogens while reading.
Sourcepub fn categories(self, categories: CategoryFilter) -> ReadOptions
pub fn categories(self, categories: CategoryFilter) -> ReadOptions
Restricts which optional categories (mmCIF/BinaryCIF) or records (PDB) are read. Names the structure cannot be built without are always read.
Sourcepub const fn digest_input(self, digest: bool) -> ReadOptions
pub const fn digest_input(self, digest: bool) -> ReadOptions
Records the SHA-256 of the bytes parsed, so a result can be tied to them.
Sourcepub const fn limits(self, limits: Limits) -> ReadOptions
pub const fn limits(self, limits: Limits) -> ReadOptions
Sets the ceilings that apply while reading.
Sourcepub fn finish(
&self,
structure: Structure,
findings: impl IntoIterator<Item = Diagnostic>,
) -> Result<(Structure, Vec<Diagnostic>), Vec<Diagnostic>>
pub fn finish( &self, structure: Structure, findings: impl IntoIterator<Item = Diagnostic>, ) -> Result<(Structure, Vec<Diagnostic>), Vec<Diagnostic>>
Finishes a read under this option set.
§Errors
Returns the ordered findings when at least one finding is an error under the selected parse mode.
Trait Implementations§
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§fn clone(&self) -> ReadOptions
fn clone(&self) -> ReadOptions
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 ReadOptions
impl Debug for ReadOptions
Source§impl Default for ReadOptions
impl Default for ReadOptions
Source§fn default() -> ReadOptions
fn default() -> ReadOptions
Auto Trait Implementations§
impl Freeze for ReadOptions
impl RefUnwindSafe for ReadOptions
impl Send for ReadOptions
impl Sync for ReadOptions
impl Unpin for ReadOptions
impl UnsafeUnpin for ReadOptions
impl UnwindSafe for ReadOptions
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