archway 0.4.0

Rust traits for Rc and Arc interoperation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use archway::*;

pub fn eq_shared_value_from_kind<P: PointerKind>(value: i32) {
    let shared = P::shared(value);
    assert_eq!(42_i32, shared.as_ref().clone())
}
pub fn eq_shared_value_from<P: AnySharedPointer<i32>>(value: i32) {
    let shared = P::from(value);
    assert_eq!(42_i32, shared.as_ref().clone())
}
pub fn eq_shared_value<T: Clone + PartialEq + core::fmt::Debug, P: AnySharedPointer<T>>(value: T, shared: P) {
    assert_eq!(value, shared.as_ref().clone())
}
pub fn eq_weak_value<T: Clone + PartialEq + core::fmt::Debug, P: AnyWeakPointer<T>>(value: T, weak: P) {
    let shared = weak.upgrade().unwrap();
    assert_eq!(value, shared.as_ref().clone())
}