Expand description
An Rc reference which has immutable access to the inner value.
It’s like a strong reference, and a immutably borrowed interior, in the same struct.
Example
use reffers::rc::Ref;
use std::collections::HashMap;
let mut z = HashMap::new();
z.insert(<Ref<_>>::new_str("Test"), 5);
assert_eq!(z.get("Test"), Some(&5));
Implementations
Returns a new Ref, or panics if this is not possible
Will panic in case a RefMut is currently held, or there are no more Refs available
Returns a new Ref, or returns an error if there are no such references available
Will return an error in case a RefMut is currently held, or there are no more Refs available
👎 Deprecated: Renamed to get_ref
Renamed to get_ref
Returns a new Ref, or panics if this is not possible
Will panic in case a RefMut is currently held, or there are no more Refs available
👎 Deprecated: Renamed to try_get_ref
Renamed to try_get_ref
Returns a new Ref, or returns an error if there are no such references available
Will return an error in case a RefMut is currently held, or there are no more Refs available
Returns a new Weak reference, or panics if there are no such references available
Returns a new Strong reference, or panics if there are no such references available
Returns a new Weak reference, or returns an error if there are no such references available
Returns a new Strong reference, or returns an error if there are no such references available
Creates a new slice reference from an iterator.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<T, M = u32> !RefUnwindSafe for Ref<T, M>
impl<T, M = u32> !UnwindSafe for Ref<T, M>
Blanket Implementations
Mutably borrows from an owned value. Read more