Struct lrs::rc::Rc

A single-threaded reference-counted container.

Syntax

struct Rc<T, Heap = Libc>
    where Heap: Allocator,
          T: Leak,
{
    /* private fields */
}

Static methods

NameDescription
new

Creates a new Rc.

Methods

ReceiverNameDescription
&selfadd_ref

Adds a new reference, returning an Rc that points to the same data.

&mut selfas_mut

Returns a mutable reference to the contained data if this is the only reference.

Trait implementations

NameDescription
Clone

Objects that can be duplicated.

Debug

Objects that can be formatted in a "debug" form.

Deref

Objects that implement the immutable dereference operator.

Drop

Objects with a destructor.

Send

Objects whose ownership can be moved from one thread to another.

UndefState

Types that are not valid when they contain certain bit patterns.