Skip to content

[Feature Request] inflateCopy and deflateCopy equivalents in the Rust API #524

Description

@robsdedude

I'm not sure if there's a deliberate design decision behind this, but it feels off that the C API libz-rs-sys offers more functionality than the pure Rust API given that this library is implemented in Rust. Implementing the Clone trait on Deflate and Inflate seems like an idiomatic fit for exposing the same functionality as provided by inflateCopy and deflateCopy in the Rust API.

Extra context

There's currently a spike going on trying to get Rust integrated into CPython. As a first goal Python's zlib module was chosen to be ported from C to Rust. While using the APIs in libz-rs-sys would be an option, it somewhat defeats the purpose by loosing much of the memory- and type-safety benefits Rust gives.

Cf. Rust-for-CPython/zlib-py#4

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