5 releases (3 breaking)

0.3.0 Jan 8, 2021
0.2.1 Dec 26, 2020
0.2.0 Dec 26, 2020
0.1.0 Dec 24, 2020
0.0.0 Dec 20, 2020

#13 in #shortcut

MIT license

20KB
190 lines

galbi

GitHub license


lib.rs:

galbi is a library that provides shortcut types for idiomatic nested types.

install

If cargo-edit is installed, you can install it like this:

cargo add galbi

If not, you have to manually add the dependency to Cargo.toml.

[dependencies]
galbi = "0.2.1"

use

It can be used in the following format. Since the automatic dereferencing trait is implemented, you can use the inner methods right away.

use galbi::*;

fn main()
{
let shared = ArcMutex::new(15);
let get = shared.lock().unwrap();
println!("{}", *get);
}

features

  • Rc<RefCell<T>> -> RcCell
  • Arc<Mutex<T>> -> ArcMutex
  • Option<Box<T>> -> OptionBox
  • ... more later

No runtime deps