Skip to content

The required buffer sizes for reading are not accessible #20

@Limeth

Description

@Limeth

Hello, thanks for the library!
I am trying to use it in my project and it's not clear to me how I should determine the size of the output buffer when reading from the database.
It would be nice if the ReadError::BufferTooSmall variant contained the actual min required size of the buffer, as it seems to be available once the key is found.
Perhaps the same thing could be done for CursorError::Key/ValueBufferTooSmall.

I just intend to resize the buffer with the returned size, but I think it would be even better if it was possible to pass in a &mut Vec<u8> rather than a &mut [u8] so that the resizing could occur right where the error would be returned from. Perhaps this could be feature-gated?

Would be interested in hearing your thoughts on this. Thanks!

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