pub enum Compression {
None,
Gzip,
Bgzf,
}Expand description
Compression applied to a sequence file.
Variants§
None
Plain, uncompressed bytes.
Gzip
One deflate stream, as gzip produces. Readable start to finish only.
Bgzf
Block-compressed gzip, as bgzip produces.
Valid gzip that any tool can decompress, but split into independent
members so that a reader with a .gzi index can seek into it. Costs a
percent or two of compression ratio and is what the samtools ecosystem
expects, so it is the default for compressed output.
Implementations§
Source§impl Compression
impl Compression
Sourcepub const GZIP_MAGIC: [u8; 2]
pub const GZIP_MAGIC: [u8; 2]
The first two bytes of a gzip member.
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Compression
pub fn from_path<P: AsRef<Path>>(path: P) -> Compression
Infer compression from a file extension.
Sourcepub fn from_magic(bytes: &[u8]) -> Compression
pub fn from_magic(bytes: &[u8]) -> Compression
Infer compression from the leading bytes of a stream.
Trait Implementations§
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Compression
Source§impl Debug for Compression
impl Debug for Compression
Source§impl Default for Compression
impl Default for Compression
Source§fn default() -> Compression
fn default() -> Compression
Returns the “default value” for a type. Read more
impl Eq for Compression
Source§impl Hash for Compression
impl Hash for Compression
Source§impl PartialEq for Compression
impl PartialEq for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnsafeUnpin for Compression
impl UnwindSafe for Compression
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§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> ⓘ
Converts
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> ⓘ
Converts
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