noodles_gff/lazy/
record.rspub mod attributes;
pub(crate) mod fields;
use core::fmt;
use std::io;
use noodles_core::Position;
pub use self::attributes::Attributes;
pub(crate) use self::fields::Fields;
use crate::record::Strand;
#[derive(Clone, Default, Eq, PartialEq)]
pub struct Record(pub(crate) Fields);
impl Record {
pub fn reference_sequence_name(&self) -> &str {
self.0.reference_sequence_name()
}
pub fn source(&self) -> &str {
self.0.source()
}
pub fn ty(&self) -> &str {
self.0.ty()
}
pub fn start(&self) -> io::Result<Position> {
self.0.start()
}
pub fn end(&self) -> io::Result<Position> {
self.0.end()
}
pub fn score(&self) -> &str {
self.0.score()
}
pub fn strand(&self) -> io::Result<Strand> {
self.0.strand()
}
pub fn phase(&self) -> &str {
self.0.phase()
}
pub fn attributes(&self) -> Attributes<'_> {
self.0.attributes()
}
}
impl fmt::Debug for Record {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Record")
.field("reference_sequence_name", &self.reference_sequence_name())
.field("source", &self.source())
.field("ty", &self.ty())
.field("start", &self.start())
.field("end", &self.end())
.field("score", &self.score())
.field("strand", &self.strand())
.field("phase", &self.phase())
.field("attributes", &self.attributes())
.finish()
}
}
impl From<Record> for String {
fn from(record: Record) -> Self {
record.0.buf
}
}