anchored-pool 0.1.0

Bounded and unbounded pools for generic resources or buffers
Documentation
  • Coverage
  • 100%
    17 out of 17 items documented0 out of 0 items with examples
  • Size
  • Source code size: 88.14 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 9.83 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • robofinch/anchored-leveldb
    4 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • robofinch

Latest version Documentation Apache 2.0 or MIT license.

Provides bounded and unbounded pools for any type of resource, as well as pools specific to Vec<u8> buffers.

The resource pools can have a user-chosen init_resource function run to create a new resource, and whenever a resource is returned to the pool, a reset_resource callback is first run.

The buffer pools use these features to create new empty Vec<u8> buffers as resources, and whenever a buffer is returned to the pool, the buffer is either cleared (without changing its capacity) if its capacity is at most a user-chosen max_buffer_capacity, and is otherwise replaced with a new empty Vec<u8>.

The unbounded pools all have a trim_unused function that can discard an excessive number of unused resources or buffers. Together with the max_buffer_capacity setting of the buffer pools, the amount of unused memory in a pool can be limited.

Features

  • clone-behavior: Implements clone-behavior traits for relevant structs.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.