5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2025-01-04 13:17:38 +03:00
Commit Graph

247 Commits

Author SHA1 Message Date
Wolfgang Bumiller
ae3ab159fc add 'full' meta-feature
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-20 15:24:28 +02:00
Wolfgang Bumiller
0a00a48cb6 decoder: less confusing generic type letters
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 11:04:08 +01:00
Wolfgang Bumiller
15e0bfe53c decoder: fix size check in read_simple_entry
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 11:02:15 +01:00
Wolfgang Bumiller
59e6f6798b cleanup: merge incomplete_*_error variables
This could be bitflags or a string, but we only use
std::io:Error and end up with a textual ErrorKind::Other
anyway. (An enum still seemed more efficient at runtime than
a String, given that this is normally a rather exceptional
case caused by the crate user...)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 09:57:07 +01:00
Wolfgang Bumiller
b9122056a8 cleanup: remove PxarStruct trait
We ended up using only twice, and it's just a tiny shortcut.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-24 09:33:53 +01:00
Wolfgang Bumiller
7b389f88a8 Symlink/Hardlink::as_os_str convenience helpers
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 15:00:15 +01:00
Wolfgang Bumiller
353bbf7339 Symlink/Hardlink: AsRef<[u8]> and update AsRef<OsStr>
Don't include the terminating nul byte in AsRef<OsStr>

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:58:35 +01:00
Wolfgang Bumiller
ae2210feaa Metadata::mtime_as_duration shortcut
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:48:28 +01:00
Wolfgang Bumiller
54912ae673 AsRef<OsStr> for Symlink and Hardlink
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:42:23 +01:00
Wolfgang Bumiller
65a8a0d581 add Entry::kind
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:34:31 +01:00
Wolfgang Bumiller
3a11ff3ea4 decoder: add content_size method
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:32:53 +01:00
Wolfgang Bumiller
6da548dd11 convenience method to get mtime as std Duration
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:32:43 +01:00
Wolfgang Bumiller
8eb622dd0e formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:11:58 +01:00
Wolfgang Bumiller
a6928cfc6d add Acl::is_empty
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 14:11:46 +01:00
Wolfgang Bumiller
a13a2f742f expose format::mode at the top level
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 13:52:01 +01:00
Wolfgang Bumiller
6100072b51 content reader for sequential decoder
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 13:42:50 +01:00
Wolfgang Bumiller
27631c163f expose 'with_goodbye_tables' decoder options
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 13:17:08 +01:00
Wolfgang Bumiller
cf12da394e add Decoder::open
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 10:17:40 +01:00
Wolfgang Bumiller
a889559e32 fix async Encoder::create
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-23 10:17:30 +01:00
Wolfgang Bumiller
327e33f21b formatting fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-19 11:07:25 +01:00
Wolfgang Bumiller
07b244df32 encoder: expose add_symlink/hardlink/device
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-19 11:06:45 +01:00
Wolfgang Bumiller
a7b9409131 buildsys: we work with stable 1.42 atm
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-19 11:06:29 +01:00
Wolfgang Bumiller
5410984044 add aio Encoder
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-18 16:10:28 +01:00
Wolfgang Bumiller
05356884d6 add AsyncWrite interface to encoder::FileImpl
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-18 15:08:56 +01:00
Wolfgang Bumiller
3fe26522fe encoder: add_device
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 11:19:10 +01:00
Wolfgang Bumiller
0abc412132 encoder: add_hardlink
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 11:12:17 +01:00
Wolfgang Bumiller
2fb73e7b11 encoder: add_symlink
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 11:10:52 +01:00
Wolfgang Bumiller
b5a471a347 encoder: encode remaining metadata
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 10:46:32 +01:00
Wolfgang Bumiller
fe8d30230e ignore testdir
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-05 10:46:18 +01:00
Wolfgang Bumiller
21e2b2fa9b examples/pxarcmd: acreate archives recursively
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-04 16:39:07 +01:00
Wolfgang Bumiller
749855a4dc encoder: actually create the binary search tree array
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-04 16:38:18 +01:00
Wolfgang Bumiller
cbe8bf5779 encoder: lifetime fixup
for some reason using these functions otherwise creates
leaves the lifetime borrowed throughout the entire
scope making it impossible to use this in a loop?

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-04 16:37:26 +01:00
Wolfgang Bumiller
96a067c5f7 add From<&std::fs::Metadata> for Metadata
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-04 16:28:00 +01:00
Wolfgang Bumiller
06e8ccc38e remove now-unused BST search function
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-04 16:27:38 +01:00
Wolfgang Bumiller
fbddffdc54 import binary search tree code from proxmox-backup
and fix accessor's hash collision handling

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-04 16:26:42 +01:00
Wolfgang Bumiller
70acf63713 start with the encoder state machine
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-04 11:47:09 +01:00
Wolfgang Bumiller
2c23bd096f don't use size_of_val for possibly empty array elements
While it is generally nicer to use something that already
contains the type (to avoid duplicate type names),
size_of_val doesn't get optimized out and the array access
will happen with all its checks, causing panics...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-03 13:32:20 +01:00
Wolfgang Bumiller
aabb78a451 documentation
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-20 12:21:18 +01:00
Wolfgang Bumiller
dbc65c4b3f api update
reexport the main accessor::sync types in accessor::

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-20 11:19:26 +01:00
Wolfgang Bumiller
9de9cca906 hide accessor::aio for now
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-20 11:17:40 +01:00
Wolfgang Bumiller
5cf335be1d cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-20 11:16:35 +01:00
Wolfgang Bumiller
c76d3f980b pxarcmd example: implement 'cat'
and fix FileContentImpl offsets

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-19 16:31:23 +01:00
Wolfgang Bumiller
dc4a2854c0 implement lookup over multiple components
add a pxarcmd test example
make 'failure' an optional dependency as we only use it in
examples right now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-19 16:03:50 +01:00
Wolfgang Bumiller
98b894a968 accessor: efficient iterator method alternatives
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-19 13:47:50 +01:00
Wolfgang Bumiller
29c17fc072 huge accessor refactoring
Turn <'a> into <T: Clone + ReadAt>. We can still use `&'a
dyn ReadAt` in its place, but we can now also support using
an `Arc<File>` to create an Accessor of a 'static lifetime
for more convenient storage and reuse. This way the Accessor
can be thrown away after calling `open_root`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-19 10:54:14 +01:00
Wolfgang Bumiller
05005b1469 let FileEntry deref to Entry
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-18 14:19:38 +01:00
Wolfgang Bumiller
6cd4f635b6 import
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-18 14:08:02 +01:00