Trait BoxExt

Source
pub trait BoxExt<T: ?Sized>: Deref<Target = T> + DerefMut<Target = T> {
    // Provided methods
    fn unbox_ref(&self) -> &T { ... }
    fn unbox_mut(&mut self) -> &mut T { ... }
}
Expand description

Extends Box with the .unbox_ref() and .unbox_mut() methods.

Provided Methods§

Source

fn unbox_ref(&self) -> &T

Returns a reference to the data stored in the Box element.

Source

fn unbox_mut(&mut self) -> &mut T

Returns a mutable reference to the data stored in the Box element.

Implementations on Foreign Types§

Source§

impl<T: ?Sized> BoxExt<T> for Box<T>

Implementors§