Struct beryl::crystal::Crystal[][src]

#[repr(transparent)]
pub struct Crystal(_);
Expand description

Wrapper struct over a u64 which provides functions to destructure a Crystal

Implementations

Create a Crystal from its raw parts

Example

let c = Crystal::from_parts(42, 42, 42).unwrap();
println!("{:?}", c);

Like Crystal::from_parts, but doesn’t ensure each part is correctly sized

Returns the ID of the Crystal’s generator

Returns the Crystal’s counter

Returns the timestamp of the Crystal’s creation

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Because some serialization formats do not support unsigned integers, we provide conversion to and from i64. This is achieved using std::mem::transmute, but is safe because we’re using u64 to represent raw bits anyway.

Performs the conversion.

Performs the conversion.

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

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.