IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
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>
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>
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>
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>
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>
When using the random accessor to access FIFOs or sockets,
the ranged reader limits the data to only that entry, and
the `decode_entry` will never see a `PAYLOAD` or
`GOODBYE_TABLE` item to finish the entry.
Instead, it'll reach EOF and we need to handle this.
The accessor now tells the decoder to expect EOF as a valid
condition for ending the entry.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
A simple `poll_read_at` with an immutable self reference
lacks the information which poll *operation* is being
polled. An associated type won't work well enough
(particularly with trait objects and lifetimes), and GATs
are unstable (and not advanced enough yet), so we need to
improvise.
To be more async-friendly, the `start_read_at()` method's
Pending now includes a reference to the operation which also
grabs the buffer lifetime, and has to be completed with
`poll_complete()`.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
to catch
- headers with full_size < size_of::<Header>
- headers with content_size > header-specific limit
both should in practice only occur for corrupted streams/archives, but
panic-ing/attempting to allocate huge amounts of memory should be
avoided even for those.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>