pub struct Job {
pub storage: Arc<Storage>,
pub format_name: &'static str,
pub units: Vec<Unit>,
pub tail_start: u64,
pub top: u64,
/* private fields */
}Fields§
§storage: Arc<Storage>§format_name: &'static str§units: Vec<Unit>Units still to do, highest offset first.
tail_start: u64§top: u64Where the archive currently ends: its original length, or wherever the last commit truncated it.
Implementations§
Source§impl Job
impl Job
Sourcepub fn open(
path: &Path,
writable: bool,
password: Option<&str>,
reads: Arc<Reads>,
) -> Result<Self>
pub fn open( path: &Path, writable: bool, password: Option<&str>, reads: Arc<Reads>, ) -> Result<Self>
password is only needed for encrypted archives. A missing one shows
up as archive::PasswordNeeded, from here or from
Job::check_password. What opening reads is counted in reads.
Sourcepub fn resume(
journal: &Journal,
tail: Arc<Tail>,
writable: bool,
password: Option<&str>,
reads: Arc<Reads>,
) -> Result<Self>
pub fn resume( journal: &Journal, tail: Arc<Tail>, writable: bool, password: Option<&str>, reads: Arc<Reads>, ) -> Result<Self>
Reopens an archive a previous run already started on. A read-only open leaves a pending truncation for the next writable one. The password is never stored, so an encrypted archive needs it again.
Sourcepub fn punch_support(&self) -> Option<u64>
pub fn punch_support(&self) -> Option<u64>
Some(granule) if holes punched in the archive give its space back,
where granule is how much may stay allocated at each end of a
punched range. None on filesystems that can only truncate, such as
FAT32 and exFAT, which keep today’s whole-unit behavior.
pub fn encrypted(&self) -> bool
Sourcepub fn kept_whole(&self, reclaims: bool) -> bool
pub fn kept_whole(&self, reclaims: bool) -> bool
The archive is one compressed stream that stays whole until the run ends, because the filesystem can’t free space inside it: the disk has to hold the archive and every extracted file at once.
Sourcepub fn check_password(&self) -> Result<()>
pub fn check_password(&self) -> Result<()>
Proves the password before anything is deleted: decrypts the smallest encrypted unit, which checks its CRC, up to a limit so a huge solid block doesn’t stall. ZipCrypto accepts about one wrong password in 256 at first sight; reading the data catches those.
Sourcepub fn slow_password_check(&self) -> Option<(&Path, u64)>
pub fn slow_password_check(&self) -> Option<(&Path, u64)>
When check_password has to decode a whole
file to prove the password, as for RAR 4: that file and its size, so
a front end can say the check may take a while.
Sourcepub fn in_place_refusal(&self) -> Option<String>
pub fn in_place_refusal(&self) -> Option<String>
Why the archive can’t be extracted in place, if it can’t. It can still be extracted while it is kept.
pub fn item_count(&self) -> usize
pub fn remaining_size(&self) -> u64
Sourcepub fn space_needed(&self, fresh: bool, reclaims: bool) -> (u64, i128)
pub fn space_needed(&self, fresh: bool, reclaims: bool) -> (u64, i128)
Replays the extraction one unit at a time and returns (peak, end):
the most free space it ever consumes beyond what is free now, and how
much it consumes once finished. fresh means the tail hasn’t been
saved yet; reclaims that freed archive space lands on the output’s
disk.
Sourcepub fn uncommitted(&self, out: &Path) -> Vec<(PathBuf, u64)>
pub fn uncommitted(&self, out: &Path) -> Vec<(PathBuf, u64)>
Output a crashed run wrote for units it never committed. Nothing was at those paths when it started, or it was moved aside before the first entry was extracted, so anything there now is ours. A half-streamed file is not in the list: its archive bytes may be gone, so it is the only copy of its first part. For a compressed tar that is the entry its point is in; the files after the point are still in the archive.
Sourcepub fn past_resume_point(&self, out: &Path) -> u64
pub fn past_resume_point(&self, out: &Path) -> u64
Output a crashed stream wrote past its last resume point. It is cut off before the stream continues, so it counts as free.
Auto Trait Implementations§
impl !Freeze for Job
impl !RefUnwindSafe for Job
impl !UnwindSafe for Job
impl Forget for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl UnsafeUnpin for Job
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
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> ⓘ
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> ⓘ
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