Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Change UnexpectedEnd to include the expected size #521

@aviramha

Description

@aviramha

Right now the enum variant of ErrorKind UnexpectedEnd is void. I suggest changing it to UnexpectedEnd(usize) so the caller will be able to know how much data it is missing for success.

This will allow development of stream protocols to be more efficient by reserving buffers & calling the decode only when data is complete.

More specifically, I'm now developing a actix-codec Encoder/Decoder and I'd wish to reserve the additional missing data before returning.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions