Struct immutable_arena::Ref
[−]
[src]
pub struct Ref<'arena, T> { // some fields omitted }
A Ref<'arena, T>
is a smart pointer type that may be used within an
arena-allocated type to hold a reference to another object within that arena.
It may be set exactly once, and is immutable thereafter. It dereferences only
to a read-only borrow, never a mutable one.
Methods
impl<'arena, T> Ref<'arena, T> where T: 'arena
[src]
fn empty() -> Ref<'arena, T>
Create a new empty Ref
. Dereferencing this reference before it is set
will panic. The reference may be set exactly once.
fn new(r: &'arena T) -> Ref<'arena, T>
Create a new Ref
from an existing ordinary borrow with the
appropriate lifetime. The resulting Ref
may not be re-set to any
other value.
fn set(&'arena self, to: &'arena T)
Set the Ref
. This may be done only once.
Trait Implementations
impl<'arena, T> Deref for Ref<'arena, T> where T: 'arena
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<'arena, T> Clone for Ref<'arena, T> where T: 'arena
[src]
fn clone(&self) -> Ref<'arena, T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more