dictionary_rs 0.2.1

dictionary is the key-value type for rust-lang
Documentation
  • Coverage
  • 0%
    0 out of 21 items documented0 out of 17 items with examples
  • Size
  • Source code size: 13.14 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.98 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • sndnvaps/dictionary-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sndnvaps

rust dictionary type

impl indexmap to deal with the key-value type

example

add this line to Cargo.toml

dictionary_rs = "0.1.0"

from_iter_main.rs

extern crate dictionary_rs as dictionary;
use dictionary::Dictionary;

fn main() {
    let tuples: Vec<(u8, u8)> = vec![(1, 3), (5, 7)];
    let _d: Dictionary<u8, u8> = Dictionary::from_iter(tuples.iter());
    let tuples_array: Vec<(u8, [u8; 5])> = vec![(2, [3, 4, 5, 6, 7]),(8,[9,10,11,12,13])];
    let _d_array: Dictionary<u8, [u8; 5]> = Dictionary::from_iter(tuples_array.iter());

    println!("{}",*_d.get(&5).unwrap());
    println!("{:?}",*_d_array.get(&8).unwrap());
}

insert.rs

extern crate dictionary_rs as dictionary;
use dictionary::Dictionary;
fn main() {
    let mut _d: Dictionary<u8, u8> = Dictionary::new();
    _d.insert(1, 2);
    _d.insert(3, 4);

    println!("{}", *_d.get(&3).unwrap());
}