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 galbiIf 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
§link
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>>