Struct build_data::OnceI64[][src]

pub struct OnceI64 { /* fields omitted */ }

Caches an i64.

Implementations

impl OnceI64[src]

#[must_use]
pub const fn new() -> Self
[src]

Makes a new empty struct.

pub fn get(
    &self,
    f: impl FnOnce() -> Result<i64, String>
) -> Result<i64, String>
[src]

Gets the value if it was already created, otherwise calls f to create it.

Thread-safe.

Errors

Returns any error returned by f.

Auto Trait Implementations

impl RefUnwindSafe for OnceI64

impl Send for OnceI64

impl Sync for OnceI64

impl Unpin for OnceI64

impl UnwindSafe for OnceI64

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, 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.