[][src]Struct flize::Shared

#[repr(transparent)]pub struct Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
{ /* fields omitted */ }

Implementations

impl<'shield, V, T> Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

pub fn null() -> Self[src]

pub unsafe fn from_ptr(ptr: *mut V) -> Self[src]

Safety

The alignment of V must free up sufficient low bits so that T fits.

pub unsafe fn from_raw(data: usize) -> Self[src]

This function constructs a Shared<'shield, V, T> from a raw tagged pointer.

Safety

This is marked unsafe because extreme caution must be taken to supply correct data and ensure the lifetime is what you expect.

pub fn into_raw(self) -> usize[src]

pub fn as_ptr(&self) -> *mut V[src]

pub unsafe fn as_ref(&self) -> Option<&'shield V>[src]

Safety

  • The pointer must either be null or point to a valid instance of V.
  • You must ensure the instance of V is not borrowed mutably.

pub unsafe fn as_mut_ref(&mut self) -> Option<&'shield mut V>[src]

Safety

  • The pointer must either be null or point to a valid instance of V.
  • You must ensure the instance of V is not borrowed.

pub unsafe fn as_ref_unchecked(&self) -> &'shield V[src]

Safety

  • The pointer must point to a valid instance of V.
  • You must ensure the instance of V is not borrowed mutably.

pub unsafe fn as_mut_ref_unchecked(&mut self) -> &'shield mut V[src]

Safety

  • The pointer must point to a valid instance of V.
  • You must ensure the instance of V is not borrowed.

pub fn is_null(&self) -> bool[src]

pub fn tag(&self) -> T[src]

pub fn with_tag(&self, tag: T) -> Self[src]

Trait Implementations

impl<'shield, V: Clone, T: Clone> Clone for Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

impl<'shield, V: Copy, T: Copy> Copy for Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

impl<'shield, V: Debug, T: Debug> Debug for Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

impl<'shield, V: Eq, T: Eq> Eq for Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

impl<'shield, V: PartialEq, T: PartialEq> PartialEq<Shared<'shield, V, T>> for Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

impl<'shield, V, T> StructuralEq for Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

impl<'shield, V, T> StructuralPartialEq for Shared<'shield, V, T> where
    V: 'shield,
    T: Tag
[src]

Auto Trait Implementations

impl<'shield, V, T> RefUnwindSafe for Shared<'shield, V, T> where
    T: RefUnwindSafe,
    V: RefUnwindSafe

impl<'shield, V, T> Send for Shared<'shield, V, T> where
    T: Send,
    V: Send

impl<'shield, V, T> Sync for Shared<'shield, V, T> where
    T: Sync,
    V: Sync

impl<'shield, V, T> Unpin for Shared<'shield, V, T> where
    T: Unpin,
    V: Unpin

impl<'shield, V, T> UnwindSafe for Shared<'shield, V, T> where
    T: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.