Skip to main content

Lazy

Trait Lazy 

Source
pub trait Lazy<T: ?Sized> {
    // Required method
    fn get(&mut self) -> &T;
}
Expand description

A lazy value.

Required Methods§

Source

fn get(&mut self) -> &T

Get a reference to the underlying value.

This will compute the value if the function is invoked for the first time.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> Lazy<[u8]> for &'a [u8]

Source§

fn get(&mut self) -> &[u8]

Implementors§