pub enum Record {
Show 18 variants
Anisou(AnisotropicRecord),
Atom(AtomRecord),
Connect(ConnectRecord),
Crystal(CrystalRecord),
DBRef(DBRefRecord),
Het(HetRecord),
Hetatm(AtomRecord),
Hetnam(HetnamRecord),
Nummdl(NummdlRecord),
MtrixN(MtrixN),
Model(ModelRecord),
Modres(ModresRecord),
OrigxN(OrigxN),
ScaleN(ScaleN),
Seqres(SeqresRecord),
Seqadv(SeqAdvRecord),
Term(TermRecord),
Endmdl(),
}
Expand description
Represents all supported PDB record types.
This enum encompasses all the different types of records that can be found in a PDB file. Each variant contains the specific data structure for that record type.
§Record Types
Anisou
- Anisotropic temperature factor recordsAtom
- Standard atom coordinate recordsConnect
- Connectivity records showing bonds between atomsCrystal
- Crystallographic unit cell parametersDBRef
- Database reference recordsHet
- Hetero-compound recordsHetatm
- Hetero-atom coordinate records (uses same structure asAtom
)Hetnam
- Hetero-compound name recordsNummdl
- Number of models in the fileMtrixN
- Transformation matrix records (N = 1, 2, or 3)Model
- Model records for multi-model structuresModres
- Modified residue recordsOrigxN
- Original coordinate system transformation (N = 1, 2, or 3)ScaleN
- Scale matrix records (N = 1, 2, or 3)Seqres
- Residue sequence recordsSeqadv
- Sequence differences from databaseTerm
- Chain termination recordsEndmdl
- End of model marker (no associated data)
§Example
use knuckles_parse::records::Record;
let line = "ATOM 1 N ALA A 1 20.154 16.967 27.462 1.00 11.18 N";
let record = Record::try_from(line).unwrap();
match record {
Record::Atom(atom) => println!("Found atom: {}", atom.name),
Record::Hetatm(hetatm) => println!("Found hetatm: {}", hetatm.name),
_ => println!("Other record type"),
}
Variants§
Anisou(AnisotropicRecord)
Anisotropic temperature factor record
Atom(AtomRecord)
Standard atom coordinate record
Connect(ConnectRecord)
Connectivity record showing bonds between atoms
Crystal(CrystalRecord)
Crystallographic unit cell parameters
DBRef(DBRefRecord)
Database reference record
Het(HetRecord)
Hetero-compound record
Hetatm(AtomRecord)
Hetero-atom coordinate record (same structure as Atom)
Hetnam(HetnamRecord)
Hetero-compound name record
Nummdl(NummdlRecord)
Number of models record
MtrixN(MtrixN)
Transformation matrix record (MTRIX1, MTRIX2, or MTRIX3)
Model(ModelRecord)
Model record for multi-model structures
Modres(ModresRecord)
Modified residue record
OrigxN(OrigxN)
Original coordinate system transformation (ORIGX1, ORIGX2, or ORIGX3)
ScaleN(ScaleN)
Scale matrix record (SCALE1, SCALE2, or SCALE3)
Seqres(SeqresRecord)
Residue sequence record
Seqadv(SeqAdvRecord)
Sequence differences from database
Term(TermRecord)
Chain termination record
Endmdl()
End of model marker
Trait Implementations§
Source§impl TryFrom<&str> for Record
impl TryFrom<&str> for Record
Source§fn try_from(line: &str) -> Result<Self, Self::Error>
fn try_from(line: &str) -> Result<Self, Self::Error>
Parse a PDB line into the appropriate Record variant.
This method examines the first 6 characters of the line to determine the record type and then delegates to the appropriate record-specific parser.
§Arguments
line
- A single line from a PDB file
§Returns
Ok(Record)
- Successfully parsed recordErr(&'static str)
- Error message if parsing failed
§Errors
Returns an error if:
- The line is shorter than 6 characters
- The record type is not recognized
- The line format is invalid for the detected record type
§Example
use knuckles_parse::records::Record;
let line = "ATOM 1 N ALA A 1 20.154 16.967 27.462 1.00 11.18 N";
let record = Record::try_from(line).unwrap();
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
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> 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