bucket 1.0.0

Offers a very simple container for any value without mutation.
Documentation
  • Coverage
  • 100%
    8 out of 8 items documented4 out of 7 items with examples
  • Size
  • Source code size: 8.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 339.92 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • FssAy/bucket
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • FssAy

Bucket

Library made for fun that offers a very simple container for any value without mutation.

Beware, it bites.

Example

See src/tests.rs for more examples.

use bucket::Bucket;

fn main() {
    let my_val: Vec<u32> = vec![1, 2, 3];

    // Creates new Bucket and takes the ownership of `my_val`.
    let bucket = Bucket::new(my_val);

    // Increases every number from the vector by 1.
    // Mutation of the Bucket isn't needed.
    for number in bucket.peek_mut().unwrap() {
        *number += 1;
    }

    // Returns content of the Bucket.
    let _ = bucket.vacate().unwrap();

    // Now the Bucket can be filled with other u32 vector.
    bucket.fill(vec![4, 4, 4]);
}