Docs.rs
  • lazy-init-0.1.0
    • lazy-init 0.1.0
    • Docs.rs crate page
    • Apache-2.0/MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • khuey
    • Dependencies
      • scoped-pool ^1.0.0
    • Versions
  • Go to latest version
  • Platform
    • i686-apple-darwin
    • i686-pc-windows-gnu
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-gnu
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Badges
    • Builds
    • Metadata
    • Shorthand URLs
    • Download
    • Rustdoc JSON
    • Build queue
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crates

  • lazy_init

Crate lazy_init [−] [src]

[−] Expand description

A crate for things that are 1) Lazily initialized 2) Expensive to create 3) Immutable after creation 4) Used on multiple threads

Lazy is better than Mutex> because after creation accessing T does not require any locking, just a single boolean load with Ordering::Acquire (which on x86 is just a compiler barrier, not an actual memory barrier).

Structs

Lazy

Lazy<T> is a lazily initialized synchronized holder type. You can think of it as a LazyTransform where the initial type doesn't exist.

LazyTransform

LazyTransform<T, U> is a synchronized holder type, that holds a value of type T until it is lazily converted into a value of type U.

Results for css

lazy_init::LazyTransform::getGet a reference to the transformed value, returning `Some(&U)` if the `LazyTransform<T, U>` has been transformed or `None` if it has not. It is guaranteed that if a reference is returned it is to the transformed value inside the the `LazyTransform<T>`. 
lazy_init::Lazy::getGet a reference to the contained value, returning `Some(ref)` if the `Lazy<T>` has been initialized or `None` if it has not. It is guaranteed that if a reference is returned it is to the value inside the `Lazy<T>`. 
lazy_init::LazyTransform::newConstruct a new, untransformed `LazyTransform<T, U>` with an argument of type T. 
lazy_init::Lazy::newConstruct a new, uninitialized `Lazy<T>`. 

Help

Keyboard Shortcuts

?
Show this help dialog
S
Focus the search field
⇤
Move up in search results
⇥
Move down in search results
⏎
Go to active search result
+
Collapse/expand all sections

Search Tricks

Prefix searches with a type followed by a colon (e.g. fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct, enum, trait, type, macro, and const.

Search functions by type signature (e.g. vec -> usize or * -> vec)