Struct noodles_cram::file_definition::FileDefinition
source · pub struct FileDefinition { /* private fields */ }
Expand description
A CRAM file definition.
The CRAM file definition holds the format version and file ID. See § 6 File definition (2020-06-22).
Implementations§
source§impl FileDefinition
impl FileDefinition
sourcepub fn new(version: Version, file_id: [u8; 20]) -> Self
pub fn new(version: Version, file_id: [u8; 20]) -> Self
Creates a file definition.
§Examples
use noodles_cram::{file_definition::Version, FileDefinition};
let file_definition = FileDefinition::new(Version::new(3, 0), [0; 20]);
sourcepub fn version(&self) -> Version
pub fn version(&self) -> Version
Returns the file version.
This is also called the (major and minor) format number.
§Examples
use noodles_cram::{file_definition::Version, FileDefinition};
let file_definition = FileDefinition::new(Version::new(3, 0), [0; 20]);
assert_eq!(file_definition.version(), Version::new(3, 0));
sourcepub fn file_id(&self) -> &[u8] ⓘ
pub fn file_id(&self) -> &[u8] ⓘ
Returns the file ID.
The file ID has a fixed length of 20 bytes. It can be any arbitrary identifier, e.g., the file name or a 160-bit checksum.
§Examples
use noodles_cram::{file_definition::Version, FileDefinition};
let file_definition = FileDefinition::new(Version::new(3, 0), [0; 20]);
assert_eq!(file_definition.file_id(), [0; 20]);
Trait Implementations§
source§impl Clone for FileDefinition
impl Clone for FileDefinition
source§fn clone(&self) -> FileDefinition
fn clone(&self) -> FileDefinition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FileDefinition
impl Debug for FileDefinition
source§impl Default for FileDefinition
impl Default for FileDefinition
source§fn default() -> FileDefinition
fn default() -> FileDefinition
Returns the “default value” for a type. Read more
source§impl PartialEq for FileDefinition
impl PartialEq for FileDefinition
source§fn eq(&self, other: &FileDefinition) -> bool
fn eq(&self, other: &FileDefinition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for FileDefinition
impl StructuralPartialEq for FileDefinition
Auto Trait Implementations§
impl Freeze for FileDefinition
impl RefUnwindSafe for FileDefinition
impl Send for FileDefinition
impl Sync for FileDefinition
impl Unpin for FileDefinition
impl UnwindSafe for FileDefinition
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.