Global

Type Alias Global 

Source
pub type Global<T> = Unique<'static, T, GlobalDeleter>;
Expand description

Alias to Unique with GlobalDeleter as second type parameter

Aliased Type§

pub struct Global<T> { /* private fields */ }

Implementations§

Source§

impl<T> Global<T>

Source

pub fn boxed(val: T) -> Self

Creates new instance using global allocator

Source§

impl<T: ?Sized> Global<T>

Source

pub fn into_boxed(self) -> Box<T>

Converts ptr to box

Trait Implementations§

Source§

impl<T: ?Sized + Clone> Clone for Global<T>

Available on crate feature alloc only.
Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: ?Sized> From<Box<T>> for Global<T>

Available on crate feature alloc only.
Source§

fn from(ptr: Box<T>) -> Self

Converts to this type from the input type.