pub struct FileCompressionType { /* private fields */ }Expand description
Readable file compression type
Implementations§
Source§impl FileCompressionType
FileCompressionType implementation
impl FileCompressionType
FileCompressionType implementation
Sourcepub const UNCOMPRESSED: Self
pub const UNCOMPRESSED: Self
Uncompressed file
Sourcepub fn get_variant(&self) -> &CompressionTypeVariant
pub fn get_variant(&self) -> &CompressionTypeVariant
Read only access to self.variant
Sourcepub const fn is_compressed(&self) -> bool
pub const fn is_compressed(&self) -> bool
The file is compressed or not
Sourcepub fn convert_to_compress_stream<'a>(
&self,
s: BoxStream<'a, Result<Bytes>>,
) -> Result<BoxStream<'a, Result<Bytes>>>
pub fn convert_to_compress_stream<'a>( &self, s: BoxStream<'a, Result<Bytes>>, ) -> Result<BoxStream<'a, Result<Bytes>>>
Given a Stream, create a Stream which data are compressed with FileCompressionType.
Sourcepub fn convert_async_writer(
&self,
w: BufWriter,
) -> Result<Box<dyn AsyncWrite + Send + Unpin>>
pub fn convert_async_writer( &self, w: BufWriter, ) -> Result<Box<dyn AsyncWrite + Send + Unpin>>
Wrap the given BufWriter so that it performs compressed writes
according to this FileCompressionType.
Trait Implementations§
Source§impl Clone for FileCompressionType
impl Clone for FileCompressionType
Source§fn clone(&self) -> FileCompressionType
fn clone(&self) -> FileCompressionType
Returns a duplicate 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 FileCompressionType
impl Debug for FileCompressionType
Source§impl From<CompressionTypeVariant> for FileCompressionType
impl From<CompressionTypeVariant> for FileCompressionType
Source§fn from(t: CompressionTypeVariant) -> Self
fn from(t: CompressionTypeVariant) -> Self
Converts to this type from the input type.
Source§impl From<FileCompressionType> for CompressionTypeVariant
impl From<FileCompressionType> for CompressionTypeVariant
Source§fn from(t: FileCompressionType) -> Self
fn from(t: FileCompressionType) -> Self
Converts to this type from the input type.
Source§impl FromStr for FileCompressionType
impl FromStr for FileCompressionType
Source§impl PartialEq for FileCompressionType
impl PartialEq for FileCompressionType
impl Copy for FileCompressionType
impl Eq for FileCompressionType
impl StructuralPartialEq for FileCompressionType
Auto Trait Implementations§
impl Freeze for FileCompressionType
impl RefUnwindSafe for FileCompressionType
impl Send for FileCompressionType
impl Sync for FileCompressionType
impl Unpin for FileCompressionType
impl UnwindSafe for FileCompressionType
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<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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