Crate galbi

Crate galbi 

Source
Expand description

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

Re-exports§

pub use option_box::*;
pub use rc_cell::*;
pub use arc_mutex::*;

Modules§

arc_mutex
It is Wrapper Type of Arc<Mutex<T>>
option_box
It is Wrapper Type of Option<Box<T>>
rc_cell
It is Wrapper Type of Rc<RefCell<T>>