Struct bonsaidb::core::key::time::limited::LimitedResolutionDuration[][src]

pub struct LimitedResolutionDuration<Resolution> where
    Resolution: TimeResolution
{ /* fields omitted */ }
Expand description

A Duration of time stored with a limited Resolution. This type may be preferred to std::time::Duration because Duration takes a full 12 bytes to achieve its nanosecond resolution.

Converting from Duration truncates the duration and performs no rounding.

The Resolution type controls the storage size. The resolutions provided by BonsaiDb:

Other resolutions can be used by implementing TimeResolution.

Implementations

Returns a new instance with the step provided, which conceptually is a unit of Resolution.

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

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Deserialize a sequence of bytes previously encoded with KeyEncoding::as_ord_bytes. Read more

Return the first value in sequence for this type. Not all types implement this. Read more

Return the next value in sequence for this type. Not all types implement this. Instead of wrapping/overflowing, None should be returned. Read more

The error type that can be produced by either serialization or deserialization. Read more

The size of the key, if constant. If this type doesn’t produce the same number of bytes for each value, this should be None. Read more

Convert self into a Cow<[u8]> containing bytes that are able to be compared via memcmp in a way that is comptaible with its own Ord implementation. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. 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.

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.

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

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

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)

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

Converts the given value to a String. 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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more