-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
903c0d1
commit 5220fda
Showing
15 changed files
with
199 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use std::io::{BufRead, Read, Seek, Write}; | ||
|
||
/// Similar to to Seek, but only require the `rewind` function | ||
pub trait SeekRewind { | ||
/// Set the IO position back at the start | ||
fn rewind(&mut self) -> std::io::Result<()>; | ||
} | ||
|
||
impl<T: Seek> SeekRewind for T { | ||
fn rewind(&mut self) -> std::io::Result<()> { | ||
<Self as Seek>::rewind(self) | ||
} | ||
} | ||
|
||
/// Pseudo-Trait for Read + SeekRewind | ||
pub trait ReadRewind: Read + SeekRewind {} | ||
impl<T: Read + SeekRewind> ReadRewind for T {} | ||
|
||
/// Pseudo-Trait for BufRead + SeekRewind | ||
pub trait BufReadRewind: BufRead + SeekRewind {} | ||
impl<T: BufRead + SeekRewind> BufReadRewind for T {} | ||
|
||
/// Pseudo-Trait for BufRead + Seek | ||
pub trait BufReadSeek: BufRead + Seek + Send {} | ||
impl<T: BufRead + Seek + Send> BufReadSeek for T {} | ||
|
||
/// Pseudo-Trait for Write + Seek | ||
pub trait WriteSeek: Write + Seek {} | ||
impl<T: Write + Seek> WriteSeek for T {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#[rustfmt::skip] | ||
#[allow(dead_code)] | ||
#[derive(Debug, Copy, Clone)] | ||
pub enum Flags { | ||
InodesStoredUncompressed = 0b0000_0000_0000_0001, | ||
DataBlockStoredUncompressed = 0b0000_0000_0000_0010, | ||
Unused = 0b0000_0000_0000_0100, | ||
FragmentsStoredUncompressed = 0b0000_0000_0000_1000, | ||
FragmentsAreNotUsed = 0b0000_0000_0001_0000, | ||
FragmentsAreAlwaysGenerated = 0b0000_0000_0010_0000, | ||
DataHasBeenDeduplicated = 0b0000_0000_0100_0000, | ||
NFSExportTableExists = 0b0000_0000_1000_0000, | ||
XattrsAreStoredUncompressed = 0b0000_0001_0000_0000, | ||
NoXattrsInArchive = 0b0000_0010_0000_0000, | ||
CompressorOptionsArePresent = 0b0000_0100_0000_0000, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.