Struct shared_slice::rc::WeakSlice [-]  [+] [src]

pub struct WeakSlice<T> {
    // some fields omitted
}

A non-owning reference-counted slice type.

This is to RcSlice as std::rc::Weak is to std::rc::Rc, and allows one to have cyclic references without stopping memory from being deallocated.

Methods

impl<T> WeakSlice<T>

fn upgrade(&self) -> Option<RcSlice<T>>

Attempt to upgrade self to a strongly-counted RcSlice.

Returns None if this is not possible (the data has already been freed).