pub struct Journal {Show 19 fields
pub version: u32,
pub format: String,
pub parts: Vec<(PathBuf, u64)>,
pub tail_start: u64,
pub tail_crc: u32,
pub output: PathBuf,
pub total_size: u64,
pub committed_len: u64,
pub links: Vec<Link>,
pub resume: Option<Resume>,
pub done: bool,
pub restoring: Option<Vec<(u64, Vec<u8>)>>,
pub keep: bool,
pub replace: Option<Replace>,
pub case_folders: Vec<PathBuf>,
pub case_beyond_ascii: bool,
pub folders: Option<Saved>,
pub folders_left: bool,
pub only: Option<Vec<PathBuf>>,
}Fields§
§version: u32§format: String§parts: Vec<(PathBuf, u64)>Every part of the archive with its original length.
tail_start: u64§tail_crc: u32§output: PathBuf§total_size: u64§committed_len: u64The archive is truncated to this once the latest batch is committed. Every unit starting at or after it is done.
links: Vec<Link>Links are made last, so nothing extracted can be written through one and every hard link’s target already exists.
resume: Option<Resume>The large file being extracted while its archive bytes are freed, if one is in progress. It always belongs to the highest uncommitted unit.
done: boolEvery unit was extracted and the final commit was journaled: only the archive’s removal and the links are left. A compressed stream lands here with its archive punched up to its last resume point, so it no longer parses from its start and must not be read again.
restoring: Option<Vec<(u64, Vec<u8>)>>Set while restore turns the archive back into a normal one: the
bytes it overwrites below committed_len, so that an interrupted
restore can be undone by putting them back and cutting off whatever it
appended.
keep: boolThe extraction keeps the archive: nothing is truncated, punched or
deleted, and committed_len only records progress. A resume keeps
it too, whatever it is asked.
replace: Option<Replace>The extraction replaces files that were in the output folder before
it started; see crate::replace.
case_folders: Vec<PathBuf>The folders, inside the output, where entries’ names differ only in
case. A resume and a restore ask about them again, not trusting the
answer from when the run began; see [crate::session::check_recorded_case].
case_beyond_ascii: boolSome of those names go outside ASCII, so a system that normalizes names may take them for one file, whatever its filesystem says about case. Asked again for the same reason.
folders: Option<Saved>The archive’s folder entries are saved in their own file, set once
every file and link is made; see [crate::folders].
folders_left: boolEvery link is made and every put-back file settled: only the folders and the cleanup are left, and a resume does just that. Making a link again would need write permission on its folder, which the folder’s own mode may have taken away by then.
only: Option<Vec<PathBuf>>Only these entries, and everything inside the folders among them, are extracted, always with the archive kept. A resume continues the same selection, whatever it is asked.
Implementations§
Source§impl Journal
impl Journal
pub fn create(paths: &Paths, storage: &Storage, plan: Plan) -> Result<Self>
Sourcepub fn check_folders(&self, paths: &Paths) -> Result<()>
pub fn check_folders(&self, paths: &Paths) -> Result<()>
For a resume, before it changes anything: the list is read at the very end, and a resume past a missing or damaged one would free the rest of the archive and only then fail. Nothing else needs the list, so a lost one stops neither a look at the archive nor a restore.
pub fn load(paths: &Paths) -> Result<(Self, Arc<Tail>)>
pub fn save(&self, paths: &Paths) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Journal
impl<'de> Deserialize<'de> for Journal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for Journal
impl Freeze for Journalwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(PathBuf, u64)>: Freeze,
PhantomData<Link>: Freeze,
*const StreamPoint is !null: Freeze,
PhantomData<StreamPoint>: Freeze,
PhantomData<(u64, Vec<u8>)>: Freeze,
PhantomData<PathBuf>: Freeze,
impl Move for Journal
impl RefUnwindSafe for Journal
impl Send for Journal
impl Sync for Journal
impl Unpin for Journal
impl UnsafeUnpin for Journalwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(PathBuf, u64)>: UnsafeUnpin,
PhantomData<Link>: UnsafeUnpin,
*const StreamPoint is !null: UnsafeUnpin,
PhantomData<StreamPoint>: UnsafeUnpin,
PhantomData<(u64, Vec<u8>)>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
impl UnwindSafe for Journal
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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