[][src]Trait leak::Leak

pub trait Leak<T: ?Sized> {
    fn leak<'a>(self) -> &'a mut T
    where
        T: 'a
; }

Leak a piece of data by never calling its destructor

Useful for things that are going to be used for the life of the program, but aren't technically static (because they are created in response to arguments, environment, or other configuration/data read at program start).

This is a modified version of the proposed rfc: https://github.com/rust-lang/rfcs/pull/1233

Notable changes:

Required methods

fn leak<'a>(self) -> &'a mut T where
    T: 'a, 

Loading content...

Implementations on Foreign Types

impl<T: ?Sized> Leak<T> for Box<T>[src]

impl Leak<str> for String[src]

impl<T> Leak<[T]> for Vec<T>[src]

Loading content...

Implementors

Loading content...