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
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.