pub struct YPFArchiveWriter<T: Write + Seek> {
writer: Arc<Mutex<T>>,
headers: Arc<Mutex<HashMap<String, YPFEntry>>>,
version: u32,
compress: bool,
zopfli: bool,
compress_level: u32,
zopfli_iteration_count: NonZeroU64,
zopfli_iterations_without_improvement: NonZeroU64,
zopfli_maximum_block_splits: u16,
runner: ThreadPool<Result<()>>,
data_hash: DataHashType,
encoding: Encoding,
}Available on crate features
yuris and yuris-arc only.Fields§
§writer: Arc<Mutex<T>>§headers: Arc<Mutex<HashMap<String, YPFEntry>>>§version: u32§compress: bool§zopfli: bool§compress_level: u32§zopfli_iteration_count: NonZeroU64§zopfli_iterations_without_improvement: NonZeroU64§zopfli_maximum_block_splits: u16§runner: ThreadPool<Result<()>>§data_hash: DataHashType§encoding: EncodingImplementations§
Source§impl<T: Write + Seek> YPFArchiveWriter<T>
impl<T: Write + Seek> YPFArchiveWriter<T>
Sourcepub fn new(
writer: T,
files: &[&str],
encoding: Encoding,
config: &ExtraConfig,
) -> Result<Self>
pub fn new( writer: T, files: &[&str], encoding: Encoding, config: &ExtraConfig, ) -> Result<Self>
Creates a new YPF Archive Writer.
writer- The writer to write the archive to.files- The list of files to include in the archive.encoding- The encoding used for the archive.config- Extra configuration options.
fn create_hasher(&self, length: u32) -> Box<dyn Hasher + Send + Sync>
fn create_hasher2(&self) -> Box<dyn Hasher + Send + Sync>
Trait Implementations§
Source§impl<T: Write + Seek + Send + Sync + 'static> Archive for YPFArchiveWriter<T>
impl<T: Write + Seek + Send + Sync + 'static> Archive for YPFArchiveWriter<T>
Source§fn new_file<'a>(
&'a mut self,
name: &str,
size: Option<u64>,
) -> Result<Box<dyn WriteSeek + 'a>>
fn new_file<'a>( &'a mut self, name: &str, size: Option<u64>, ) -> Result<Box<dyn WriteSeek + 'a>>
Creates a new file in the archive. Read more
Source§fn new_file_non_seek<'a>(
&'a mut self,
name: &str,
size: Option<u64>,
) -> Result<Box<dyn Write + 'a>>
fn new_file_non_seek<'a>( &'a mut self, name: &str, size: Option<u64>, ) -> Result<Box<dyn Write + 'a>>
Creates a new file in the archive that does not require seeking. Read more
Source§fn write_header(&mut self) -> Result<()>
fn write_header(&mut self) -> Result<()>
Writes the header of the archive. (Must be called after writing all files.)
Auto Trait Implementations§
impl<T> Freeze for YPFArchiveWriter<T>
impl<T> !RefUnwindSafe for YPFArchiveWriter<T>
impl<T> Send for YPFArchiveWriter<T>where
T: Send,
impl<T> Sync for YPFArchiveWriter<T>where
T: Send,
impl<T> Unpin for YPFArchiveWriter<T>
impl<T> !UnwindSafe for YPFArchiveWriter<T>
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> 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