#[repr(transparent)]pub struct Ref<A, T: ?Sized> {
pub val: A,
/* private fields */
}
Expand description
A wrapper around a base type A
to indicate that the value is pointing to
a value of type T
.
This is not a strict type safety barrier; it is possible to convert a Ref
to and from its raw version. However this can help in API documentation,
as well as to assist type inference in functions like LocalMap::get
.
Fields§
§val: A
The underlying storage or “raw” value.
Implementations§
Trait Implementations§
impl<A: Copy, T: Copy + ?Sized> Copy for Ref<A, T>
Auto Trait Implementations§
impl<A, T> Freeze for Ref<A, T>
impl<A, T> RefUnwindSafe for Ref<A, T>
impl<A, T> Send for Ref<A, T>
impl<A, T> Sync for Ref<A, T>
impl<A, T> Unpin for Ref<A, T>
impl<A, T> UnwindSafe for Ref<A, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more