pub struct UnitInterner { /* private fields */ }
Expand description

A small structure used to “intern” Unit values.

A Unit is just a thin pointer to an internal UnitInner. This is done to ensure that Unit itself is quite small as well as enabling a very efficient hash/equality implementation for Unit. All units are manufactured through an interner which guarantees that each equivalent value is only produced once.

Implementations

Creates a new blank interner

Creates a new unit from its components. The returned Unit’s fields will all be equivalent to the provided arguments, although they may not be the exact same instance.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.