]> git.proxmox.com Git - pxar.git/log
pxar.git
7 weeks agodoc fixup master
Wolfgang Bumiller [Tue, 30 Jul 2024 13:52:41 +0000 (15:52 +0200)]
doc fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agofixup upload command
Wolfgang Bumiller [Thu, 20 Jun 2024 11:35:49 +0000 (13:35 +0200)]
fixup upload command

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobump version to 0.12.0-2 (released)
Wolfgang Bumiller [Thu, 20 Jun 2024 11:34:57 +0000 (13:34 +0200)]
bump version to 0.12.0-2 (released)

previous bump was still marked as UNRELEASED and uploaded to wrong
repo.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobuild system upgrade
Wolfgang Bumiller [Thu, 20 Jun 2024 11:33:21 +0000 (13:33 +0200)]
build system upgrade

and detect upload-distro...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobump version to 0.12.0-2
Wolfgang Bumiller [Thu, 20 Jun 2024 11:08:15 +0000 (13:08 +0200)]
bump version to 0.12.0-2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agodrop bitflags dependency
Wolfgang Bumiller [Thu, 20 Jun 2024 11:06:55 +0000 (13:06 +0200)]
drop bitflags dependency

we aren't using it...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agomove .cargo/config to .cargo/config.toml
Fabian Grünbichler [Thu, 20 Jun 2024 10:38:23 +0000 (12:38 +0200)]
move .cargo/config to .cargo/config.toml

the old location has been deprecated for a while, and rustc 1.78 will start to warn about it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoupdate d/control
Fabian Grünbichler [Mon, 17 Jun 2024 08:19:21 +0000 (10:19 +0200)]
update d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agobump version to 0.12.0-1
Fabian Grünbichler [Fri, 14 Jun 2024 10:50:49 +0000 (12:50 +0200)]
bump version to 0.12.0-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoaccessor: adapt and restrict contents access
Christian Ebner [Wed, 12 Jun 2024 13:17:12 +0000 (15:17 +0200)]
accessor: adapt and restrict contents access

Add checks for split variant inputs when accessing the payload
contents via the accessor instance. Both cases, accessing via the
safe `contents` method and via the previousely unsafe
`open_contents_at_range` call are covered.

Reduce possible misuse by wrapping the current plain content range
into an opaque `ContentRange` type with an additional optional
payload reference field to check consistency between the payload
reference encoded in the metadata archive and the payload header'
found in the payload data archive.

Because of the additional type wrapping and the payload header check,
the `open_contents_at_range` is considered safe now, dropping the
previously unsafe implementation.
The corresponding interfaces have been adapted accordingly.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agotests: adapt tests to decoder interface changes
Christian Ebner [Wed, 12 Jun 2024 13:17:11 +0000 (15:17 +0200)]
tests: adapt tests to decoder interface changes

The `Decoder`s `contents` method call can fail because of an added
consistency check when using split variant inputs.

Therefore, the additional error has to be handled by the callers.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoremove unnecessary unsafe in test
Fabian Grünbichler [Wed, 12 Jun 2024 09:26:06 +0000 (11:26 +0200)]
remove unnecessary unsafe in test

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agodecoder: move payload header check for split input
Christian Ebner [Wed, 12 Jun 2024 08:23:58 +0000 (10:23 +0200)]
decoder: move payload header check for split input

The payload entries in the payload output for split pxar archives are
separated by payload headers, which allow to perform consistency
checks for the payload references encoded in the metadata archive.

Currently, this consistency check is performed right after reading the
entry in the metadata archive, which however has the downside that the
payload has to be fetched and decoded just for this consistency check.
This greatly impacts performance when accessing a metadata archive
with attached payload input reader, e.g. in the fuse implementation to
mount pxar archives, being especially severe when accessed over the
network in combination with a remote chunk reader as the Proxmox
Backup Server does.

Therefore, move this check to the contents reader instantiation
instead and add an additional flag to the decoder's `InPayload` state.

Getting the decoder now needs to be async and the method must return
an error when the check fails.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoformat: add helper for payload header consistency checks
Christian Ebner [Wed, 12 Jun 2024 08:23:56 +0000 (10:23 +0200)]
format: add helper for payload header consistency checks

The helper method will be used to check the payload header being
consistent with what was encoded as paylaod reference for split
pxar archives.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoaccessor: fix minor formatting issue
Christian Ebner [Wed, 12 Jun 2024 08:23:55 +0000 (10:23 +0200)]
accessor: fix minor formatting issue

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoupdate d/control
Fabian Grünbichler [Mon, 10 Jun 2024 11:45:23 +0000 (13:45 +0200)]
update d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agobump version to 0.11.1-1
Fabian Grünbichler [Mon, 10 Jun 2024 11:36:27 +0000 (13:36 +0200)]
bump version to 0.11.1-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agocargo fmt
Fabian Grünbichler [Mon, 10 Jun 2024 11:35:48 +0000 (13:35 +0200)]
cargo fmt

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoprelude: drop OsStr implementation
Fabian Grünbichler [Mon, 10 Jun 2024 11:35:17 +0000 (13:35 +0200)]
prelude: drop OsStr implementation

this was leftover and not does not make sense with the current version of the
Prelude, which is an opaque blob of bytes.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoupdate d/control
Fabian Grünbichler [Wed, 5 Jun 2024 14:04:41 +0000 (16:04 +0200)]
update d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agobump version to 0.11.0-1
Fabian Grünbichler [Wed, 5 Jun 2024 14:02:48 +0000 (16:02 +0200)]
bump version to 0.11.0-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoformat/encoder/decoder: new pxar entry type `Prelude`
Christian Ebner [Fri, 22 Mar 2024 14:08:30 +0000 (15:08 +0100)]
format/encoder/decoder: new pxar entry type `Prelude`

Introduces a new pxar format entry type `Prelude` and the associated
encoder and decoder methods.
A prelude starts with header marker `PXAR_PRELUDE` followed by raw
byte content, used to store additional metadata associated with the
pxar archive, e.g. command line arguments passed on archive creation.

The prelude's content has no fixed encoding format but is stored as
an raw, arbitrary byte slice. A prelude entry is encoded right after
a pxar format version entry, both being encoded in the metadata
archive in case of an archive with dedicated payload output.

The prelude is not backwards compatible to pxar format version 1.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoformat/encoder/decoder: new pxar entry type `Version`
Christian Ebner [Fri, 22 Mar 2024 11:13:17 +0000 (12:13 +0100)]
format/encoder/decoder: new pxar entry type `Version`

Introduces a new pxar format entry type `Version` and the associated
encoder and decoder methods. The format version entry is only allowed
once, as the first entry of the pxar archive, marked with a
`PXAR_FORMAT_VERSION` header followed by the encoded version number.
If not present, the default format version 1 is assumed as encoding
format for the archive.

The entry allows to early detect incompatibility with an encoded
archive and bail or switch mode based on the encountered version.

The format version entry is not backwards compatible to pxar format
version 1.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoformat: add payload stream start marker
Christian Ebner [Thu, 21 Mar 2024 18:24:13 +0000 (19:24 +0100)]
format: add payload stream start marker

Mark the beginning of the payload stream with a magic number. Allows for
version and file type detection.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoencoder/format: finish payload stream with marker
Christian Ebner [Mon, 26 Feb 2024 11:08:30 +0000 (12:08 +0100)]
encoder/format: finish payload stream with marker

Mark the end of the optional payload stream, this makes sure that at
least some bytes are written to the stream (as empty archives are not
allowed by the proxmox backup server) and possible injected chunks
must be consumed.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoencoder: add payload advance capability
Christian Ebner [Tue, 20 Feb 2024 13:07:14 +0000 (14:07 +0100)]
encoder: add payload advance capability

Allows to advance the payload writer position by a given size.
This is used to update the encoders payload input position when
injecting reused chunks for files with unchanged metadata.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoencoder: add payload position capability
Christian Ebner [Wed, 13 Mar 2024 08:00:21 +0000 (09:00 +0100)]
encoder: add payload position capability

Allows to read the current payload offset from the dedicated payload
input stream. This is required to get the current offset for calculation
of forced boundaries in the proxmox-backup-client, when injecting reused
payload chunks into the payload stream.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoencoder: add payload reference capability
Christian Ebner [Wed, 13 Mar 2024 08:06:28 +0000 (09:06 +0100)]
encoder: add payload reference capability

Allows to encode regular files with a payload reference within a
separate payload archive rather than encoding the payload within the
regular archive.

Following the PXAR_PAYLOAD_REF marked header, the payload offset and
size are encoded.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agodecoder: set payload input range when decoding via accessor
Christian Ebner [Mon, 29 Apr 2024 08:41:18 +0000 (10:41 +0200)]
decoder: set payload input range when decoding via accessor

When accessing the file contents via the sequential file restore
the range of the payload contents cannot be inferred a-priori but need
to be calculated based on the payload references encountered during
decoding.

Extending the `SeqRead` trait by the method `update_range` allows to
set the range in the payload reader instance by implementing the
method for `SeqReadAtAdapter`, thereby setting the correct content
range to be accessed.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agodecoder/accessor: allow for split input stream variant
Christian Ebner [Tue, 12 Mar 2024 14:06:44 +0000 (15:06 +0100)]
decoder/accessor: allow for split input stream variant

When a pxar archive was encoded using the split stream output
variant, access to the payload of regular files has to be redirected
to the corresponding dedicated input.

Allow to pass the split input variant to the decoder and accessor
instances to handle the split streams accordingly and decode split
stream archives.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoencoder: allow split output writer for archive creation
Christian Ebner [Thu, 1 Feb 2024 08:47:18 +0000 (09:47 +0100)]
encoder: allow split output writer for archive creation

During regular pxar archive encoding, the payload of regular files is
written as part of the archive.

This patch introduces functionality to instead attach a writer variant
with a split payload writer instance to redirect the payload to a
different output.
The separation of data and metadata streams allows for efficient
reuse of payload data by referencing the payload writer byte offset,
without having to reencode it.

Whenever the payload of regular files is redirected to a dedicated
output writer, encode a payload reference header followed by the
required data to locate the data, instead of adding the regular payload
header followed by the encoded payload to the archive.

This is in preparation for reusing payload chunks for unchanged files
of backups created via the proxmox-backup-client.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agodecoder: add method to read payload references
Christian Ebner [Tue, 12 Mar 2024 13:12:49 +0000 (14:12 +0100)]
decoder: add method to read payload references

This is in preparation for reading payloads from a dedicated payload
input stream.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoformat/examples: add header type `PXAR_PAYLOAD_REF`
Christian Ebner [Thu, 1 Feb 2024 11:51:56 +0000 (12:51 +0100)]
format/examples: add header type `PXAR_PAYLOAD_REF`

Introduces the header type `PXAR_PAYLOAD_REF` to mark regular file
entry payloads, not encoded within the regular pxar archive but
rather redirected to a dedicated payload output writer.
It therefore substitutes the `PXAR_PAYLOAD` header type for these
entries.

The header marks the start and size for a `PayloadRef` typed object
in the archive, storing the offset to the payload header offset in the
payload stream of the dedicated payload output as well as the payload
size.

The `PayloadRef` provides the means to store, serialize and
deserialize the entry.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agoencoder: move to stack based state tracking
Christian Ebner [Tue, 19 Mar 2024 13:51:08 +0000 (14:51 +0100)]
encoder: move to stack based state tracking

In preparation for the proxmox-backup-client look-ahead caching,
where a passing around of different encoder instances with internal
references is not feasible.

Instead of creating a new encoder instance for each directory level
and keeping references to the parent state, use an internal stack.
Adds additional helper functions to solve borrow issues, when both
the state and writers have to be accessed by a mutable reference.

This is a breaking change in the pxar library API.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agolib: add type for input/output variant differentiation
Christian Ebner [Thu, 23 May 2024 06:54:58 +0000 (08:54 +0200)]
lib: add type for input/output variant differentiation

Introduce an enum which stores 2 different possible variants of
inputs or outputs to be passed to encoder and decoder/accessor
instances, depending whether to read/write a fully self contained
pxar archive or whether to split off the payload stream into a
separate input/output.

Co-authored-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
3 months agodecoder: factor out skip part from skip_entry
Christian Ebner [Tue, 12 Mar 2024 14:03:41 +0000 (15:03 +0100)]
decoder: factor out skip part from skip_entry

Make the skip part reusable for a different input.

In preparation for skipping payload paddings in a separated input.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 months agoencoder: fix some more typos/phrasing
Fabian Grünbichler [Wed, 3 Apr 2024 09:11:40 +0000 (11:11 +0200)]
encoder: fix some more typos/phrasing

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
5 months agoencoder: fix two typos in comments
Christian Ebner [Thu, 28 Mar 2024 12:36:10 +0000 (13:36 +0100)]
encoder: fix two typos in comments

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
6 months agoformat/examples: Fix typo in PXAR_PAYLOAD description
Christian Ebner [Wed, 28 Feb 2024 14:01:51 +0000 (15:01 +0100)]
format/examples: Fix typo in PXAR_PAYLOAD description

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
13 months agodoc fixup
Wolfgang Bumiller [Fri, 4 Aug 2023 11:11:03 +0000 (13:11 +0200)]
doc fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
13 months agodecoder: aio: Make `TokioReader` public
Max Carrara [Fri, 21 Jul 2023 15:58:19 +0000 (17:58 +0200)]
decoder: aio: Make `TokioReader` public

This exposes `decoder::aio::TokioReader<T>` in a similar manner to
`decoder::sync::StandardReader<T>`, which is necessary if one wants
to remain generic over `T: tokio::io::AsyncRead`, e.g.:

> struct FooDecoder<T: tokio::io::AsyncRead> {
>    decoder: aio::Decoder<aio::TokioReader<T>>,
> }

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
13 months agod/changelog: fix typo
Fabian Grünbichler [Mon, 31 Jul 2023 13:45:17 +0000 (15:45 +0200)]
d/changelog: fix typo

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
16 months agoformat: Document source of format const values
Christian Ebner [Fri, 28 Apr 2023 08:54:43 +0000 (10:54 +0200)]
format: Document source of format const values

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
20 months agodrop custom poll_fn, require rust 1.64
Wolfgang Bumiller [Fri, 13 Jan 2023 12:37:17 +0000 (13:37 +0100)]
drop custom poll_fn, require rust 1.64

this was added to std in 1.64

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
20 months agoupdate d/control
Fabian Grünbichler [Mon, 9 Jan 2023 12:33:47 +0000 (13:33 +0100)]
update d/control

after debcargo update

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agobump upload target
Wolfgang Bumiller [Thu, 27 Oct 2022 13:31:33 +0000 (15:31 +0200)]
bump upload target

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agobump d/control
Wolfgang Bumiller [Thu, 27 Oct 2022 13:29:14 +0000 (15:29 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agobump version to 0.10.2-1
Wolfgang Bumiller [Thu, 27 Oct 2022 13:28:22 +0000 (15:28 +0200)]
bump version to 0.10.2-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agoclippy fixup
Wolfgang Bumiller [Thu, 27 Oct 2022 13:25:50 +0000 (15:25 +0200)]
clippy fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agoderive PartialEq trait for Metadata and related structs
Lukas Wagner [Thu, 27 Oct 2022 12:28:05 +0000 (14:28 +0200)]
derive PartialEq trait for Metadata and related structs

This change is needed in order to compare a file's metadata
in the coming proxmox-backup-debug diff tool.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
22 months agofix fifo and socket entry kinds in accessor
Wolfgang Bumiller [Thu, 27 Oct 2022 13:17:39 +0000 (15:17 +0200)]
fix fifo and socket entry kinds in accessor

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agotest socket/fifo entry kinds in accessor
Wolfgang Bumiller [Thu, 27 Oct 2022 12:59:49 +0000 (14:59 +0200)]
test socket/fifo entry kinds in accessor

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoupdate buildbot.yml for tokio 1.18
Wolfgang Bumiller [Thu, 28 Jul 2022 12:54:01 +0000 (14:54 +0200)]
update buildbot.yml for tokio 1.18

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodon't hold temp buffer mutex across await point
Wolfgang Bumiller [Thu, 28 Jul 2022 12:36:46 +0000 (14:36 +0200)]
don't hold temp buffer mutex across await point

the type system guarantees that this can only be accessed by
a single mutable instance, but it's still a bad idea

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agotrivial clippy fixes
Wolfgang Bumiller [Thu, 28 Jul 2022 12:36:43 +0000 (14:36 +0200)]
trivial clippy fixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodrop imports already in 2021 prelude
Wolfgang Bumiller [Wed, 1 Dec 2021 13:14:47 +0000 (14:14 +0100)]
drop imports already in 2021 prelude

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoanother clippy fixup
Wolfgang Bumiller [Wed, 1 Dec 2021 13:10:33 +0000 (14:10 +0100)]
another clippy fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoclippy fixes
Wolfgang Bumiller [Wed, 1 Dec 2021 13:09:10 +0000 (14:09 +0100)]
clippy fixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoupgrade to edition 2021
Wolfgang Bumiller [Wed, 1 Dec 2021 12:54:52 +0000 (13:54 +0100)]
upgrade to edition 2021

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomore clippy fixes
Wolfgang Bumiller [Fri, 12 Nov 2021 12:53:47 +0000 (13:53 +0100)]
more clippy fixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agouse #![deny(unsafe_op_in_unsafe_fn)]
Wolfgang Bumiller [Fri, 12 Nov 2021 12:52:00 +0000 (13:52 +0100)]
use #![deny(unsafe_op_in_unsafe_fn)]

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobuildbot.yml: remove tokio+fs dep
Wolfgang Bumiller [Tue, 5 Oct 2021 07:30:30 +0000 (09:30 +0200)]
buildbot.yml: remove tokio+fs dep

it's provided by the tokio main package and we have an old
real package around which causes buildbot issues

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoadd back .buildbot.yml
Wolfgang Bumiller [Mon, 4 Oct 2021 13:29:46 +0000 (15:29 +0200)]
add back .buildbot.yml

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Mon, 4 Oct 2021 13:07:54 +0000 (15:07 +0200)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofix deprecated use of std::u64 modules
Wolfgang Bumiller [Mon, 4 Oct 2021 13:00:43 +0000 (15:00 +0200)]
fix deprecated use of std::u64 modules

MAX values in these modules are replaced by associated
constants in the integer types

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoadd more code documentation
Wolfgang Bumiller [Mon, 17 May 2021 12:05:10 +0000 (14:05 +0200)]
add more code documentation

all but the `format` module are now #![deny(missing_docs)]

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agomake the ReadAtImpl enum variants private
Wolfgang Bumiller [Mon, 17 May 2021 12:04:52 +0000 (14:04 +0200)]
make the ReadAtImpl enum variants private

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoditch anyhow crate in examples/tests
Wolfgang Bumiller [Mon, 17 May 2021 09:46:50 +0000 (11:46 +0200)]
ditch anyhow crate in examples/tests

mostly to shutup our current buildbot tests

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agosome clippy fixes
Wolfgang Bumiller [Fri, 7 May 2021 09:57:28 +0000 (11:57 +0200)]
some clippy fixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 0.10.1-1
Wolfgang Bumiller [Wed, 31 Mar 2021 11:56:22 +0000 (13:56 +0200)]
bump version to 0.10.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agorustfmt
Wolfgang Bumiller [Wed, 31 Mar 2021 11:54:18 +0000 (13:54 +0200)]
rustfmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agodecoder/aio: add contents() and content_size() calls
Stefan Reiter [Wed, 31 Mar 2021 10:21:43 +0000 (12:21 +0200)]
decoder/aio: add contents() and content_size() calls

Returns a decoder::Contents without a wrapper type, since in this case
we don't want to hide the SeqRead implementation (as done in
decoder::sync). For conviencience also implement AsyncRead if "tokio-io"
is enabled.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agorustfmt
Wolfgang Bumiller [Wed, 31 Mar 2021 11:52:09 +0000 (13:52 +0200)]
rustfmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoencoder: only flush owned outputs in 'finish'
Wolfgang Bumiller [Wed, 31 Mar 2021 11:51:46 +0000 (13:51 +0200)]
encoder: only flush owned outputs in 'finish'

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoencoder: flush after writing last entry
Dominik Csapak [Wed, 24 Mar 2021 10:56:38 +0000 (11:56 +0100)]
encoder: flush after writing last entry

some writers may need to be flushed to write out all data

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agorustfmt
Wolfgang Bumiller [Fri, 12 Mar 2021 09:42:14 +0000 (10:42 +0100)]
rustfmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 0.10.0-1
Wolfgang Bumiller [Fri, 12 Mar 2021 09:38:03 +0000 (10:38 +0100)]
bump version to 0.10.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoexplicitly pad StatxTimestamp with zeros
Wolfgang Bumiller [Fri, 12 Mar 2021 09:34:17 +0000 (10:34 +0100)]
explicitly pad StatxTimestamp with zeros

otherwise we can have random data in there

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoupdate d/control
Wolfgang Bumiller [Wed, 17 Feb 2021 08:55:26 +0000 (09:55 +0100)]
update d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 0.9.0-1
Wolfgang Bumiller [Wed, 17 Feb 2021 08:54:38 +0000 (09:54 +0100)]
bump version to 0.9.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoadd EncoderOutput::to_borrowed()
Wolfgang Bumiller [Wed, 17 Feb 2021 08:50:10 +0000 (09:50 +0100)]
add EncoderOutput::to_borrowed()

may more "explicit" than using `.as_mut().into()`, but
otherwise just seems like a useful addition to show the
lifetime constraints on this

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agorevert Send requirement from previous patch
Wolfgang Bumiller [Wed, 17 Feb 2021 08:23:29 +0000 (09:23 +0100)]
revert Send requirement from previous patch

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agomake aio::Encoder actually behave with async
Stefan Reiter [Tue, 9 Feb 2021 12:03:47 +0000 (13:03 +0100)]
make aio::Encoder actually behave with async

To really use the encoder with async/await, it needs to support
SeqWrite implementations that are Send. This requires changing a whole
bunch of '&mut dyn SeqWrite' trait objects to instead take a 'T:
SeqWrite' generic parameter directly instead. Most of this is quite
straightforward, though incurs a lot of churn (FileImpl needs a generic
parameter now for example).

The trickiest part is returning a new Encoder instance in
create_directory, as the trait object trick with
SeqWrite::as_trait_object doesn't work if SeqWrite is implemented for
generic '&mut S'.

Instead, work with the generic object directly, and express the
owned/borrowed state in the Encoder (to avoid nested borrowing) as an
enum EncoderOutput.

Add to the aio test to ensure the Encoder is now actually useable.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agocargo fmt
Wolfgang Bumiller [Tue, 2 Feb 2021 09:54:36 +0000 (10:54 +0100)]
cargo fmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agomake Send test not depend on tokio
Wolfgang Bumiller [Tue, 2 Feb 2021 09:54:11 +0000 (10:54 +0100)]
make Send test not depend on tokio

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agobump version to 0.8.0-1
Wolfgang Bumiller [Tue, 2 Feb 2021 09:50:03 +0000 (10:50 +0100)]
bump version to 0.8.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agofix Encoder to be Send + Sync
Wolfgang Bumiller [Tue, 2 Feb 2021 09:47:56 +0000 (10:47 +0100)]
fix Encoder to be Send + Sync

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agodebcargo: fix maintainer directive
Fabian Grünbichler [Mon, 1 Feb 2021 10:21:17 +0000 (11:21 +0100)]
debcargo: fix maintainer directive

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agodrop futures dependency
Wolfgang Bumiller [Fri, 15 Jan 2021 13:59:29 +0000 (14:59 +0100)]
drop futures dependency

we're not actually using it anymore now

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agotypo fix: this was supposed to be from_tokio
Wolfgang Bumiller [Fri, 15 Jan 2021 13:42:31 +0000 (14:42 +0100)]
typo fix: this was supposed to be from_tokio

it's on `tokio-io` after all and there previously used to be
a `form_futures` for the `Async*` traits from `futures`

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoclippy fixups
Wolfgang Bumiller [Fri, 15 Jan 2021 13:24:50 +0000 (14:24 +0100)]
clippy fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agomove extra build-dependencies from .builtbot.yml to d/control
Thomas Lamprecht [Fri, 15 Jan 2021 09:07:53 +0000 (10:07 +0100)]
move extra build-dependencies from .builtbot.yml to d/control

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoadd futures to builbot.yml
Thomas Lamprecht [Thu, 14 Jan 2021 15:45:57 +0000 (16:45 +0100)]
add futures to builbot.yml

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoupdate builbot.yml for tokio 1.0
Thomas Lamprecht [Thu, 14 Jan 2021 15:30:53 +0000 (16:30 +0100)]
update builbot.yml for tokio 1.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 0.7.0-1
Fabian Grünbichler [Thu, 14 Jan 2021 14:26:40 +0000 (15:26 +0100)]
bump version to 0.7.0-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agobuild: fix --no-default-features
Fabian Grünbichler [Thu, 14 Jan 2021 14:26:16 +0000 (15:26 +0100)]
build: fix --no-default-features

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agofix example
Wolfgang Bumiller [Wed, 13 Jan 2021 08:59:58 +0000 (09:59 +0100)]
fix example

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoremove futures-io feature
Fabian Grünbichler [Mon, 11 Jan 2021 12:59:49 +0000 (13:59 +0100)]
remove futures-io feature

we don't use it, and it adds unnecessary duplication/complexity.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoclippy: use matches! instead of match
Fabian Grünbichler [Mon, 11 Jan 2021 13:47:45 +0000 (14:47 +0100)]
clippy: use matches! instead of match

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agoupdate to tokio 1.0
Fabian Grünbichler [Fri, 4 Dec 2020 10:39:55 +0000 (11:39 +0100)]
update to tokio 1.0

unfortunately, futures::io::AsyncRead and tokio::io::AsyncRead no longer
share a do_poll_read signature, so we need to adapt one to the other
(and also no longer generate some wrapper implementations via macro).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>