Struct rustc_data_structures::ivar::Ivar [] [src]

pub struct Ivar<T: Copy> { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (rustc_private)

A write-once variable. When constructed, it is empty, and can only be set once.

Ivars ensure that data that can only be initialised once. A full implementation is used for concurrency and blocks on a read of an unfulfilled value. This implementation is more minimal and panics if you attempt to read the value before it has been set. It is also not Sync, but may be extended in the future to be usable as a true concurrency type.

The T: Copy bound is not strictly needed, but it is required by Cell (so removing it would require using UnsafeCell), and it suffices for the current purposes.

Methods

impl<T: Copy> Ivar<T>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

Trait Implementations

impl<T: PartialEq + Copy> PartialEq for Ivar<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Copy + Debug> Debug for Ivar<T>
[src]

Formats the value using the given formatter.

impl<T: Copy> Clone for Ivar<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more