[−][src]Struct thin_dst::ThinRc
A thin version of Rc
.
Methods
impl<Head, SliceItem> ThinRc<Head, SliceItem>
[src]
pub unsafe fn from_erased(ptr: ErasedPtr) -> Self
[src]
Construct an owned pointer from an erased pointer.
Safety
This pointer must logically own a valid instance of Self
.
pub fn erase(this: Self) -> ErasedPtr
[src]
Convert this owned pointer into an erased pointer.
To avoid a memory leak the pointer must be converted back
using Self::from_erased
.
impl<Head, SliceItem> ThinRc<Head, SliceItem>
[src]
pub fn new<I>(head: Head, slice: I) -> Self where
I: IntoIterator<Item = SliceItem>,
I::IntoIter: ExactSizeIterator,
[src]
I: IntoIterator<Item = SliceItem>,
I::IntoIter: ExactSizeIterator,
Create a new reference counted ThinData
with the given head and slice.
Panics
Panics if the slice iterator incorrectly reports its length.
Note on allocation
This currently creates a ThinBox
first and then moves that into an Rc
.
This is required, because the heap layout of Rc
is not stable,
and custom DSTs need to be manually allocated.
This will be eliminated in the future if/when the reference counted heap layout is stabilized.
Trait Implementations
impl<Head, SliceItem> Clone for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: Clone,
[src]
Rc<ThinData<Head, SliceItem>>: Clone,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Head, SliceItem> Debug for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: Debug,
[src]
Rc<ThinData<Head, SliceItem>>: Debug,
impl<Head, SliceItem> Deref for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: Deref,
[src]
Rc<ThinData<Head, SliceItem>>: Deref,
type Target = ThinData<Head, SliceItem>
The resulting type after dereferencing.
fn deref(&self) -> &ThinData<Head, SliceItem>
[src]
impl<Head, SliceItem> DerefMut for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: DerefMut,
[src]
Rc<ThinData<Head, SliceItem>>: DerefMut,
impl<Head, SliceItem> Drop for ThinRc<Head, SliceItem>
[src]
impl<Head, SliceItem> Eq for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: Eq,
[src]
Rc<ThinData<Head, SliceItem>>: Eq,
impl<Head, SliceItem> From<Rc<ThinData<Head, SliceItem>>> for ThinRc<Head, SliceItem>
[src]
impl<Head, SliceItem> From<ThinRc<Head, SliceItem>> for Rc<ThinData<Head, SliceItem>>
[src]
impl<Head, SliceItem> Hash for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: Hash,
[src]
Rc<ThinData<Head, SliceItem>>: Hash,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<Head, SliceItem> PartialEq<Rc<ThinData<Head, SliceItem>>> for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: PartialEq,
[src]
Rc<ThinData<Head, SliceItem>>: PartialEq,
fn eq(&self, other: &Rc<ThinData<Head, SliceItem>>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Head, SliceItem> PartialEq<ThinRc<Head, SliceItem>> for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: PartialEq,
[src]
Rc<ThinData<Head, SliceItem>>: PartialEq,
impl<Head, SliceItem> Send for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: Send,
[src]
Rc<ThinData<Head, SliceItem>>: Send,
impl<Head, SliceItem> Sync for ThinRc<Head, SliceItem> where
Rc<ThinData<Head, SliceItem>>: Sync,
[src]
Rc<ThinData<Head, SliceItem>>: Sync,
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,