Struct bonsaidb::core::ordered_varint::Signed[]

pub struct Signed(_);
Expand description

A signed integer value.

This type encodes values in the range -2.pow(123)..2.pow(123) by using the first 5 bits to denote a signed byte length. This length ranges from -15..=15. The number of bytes read is always absolute, but the sign of the length is used to determine the overall sign of the encoded value. The remaining 3 bits of the first byte and any additional bytes are then used to store the integer in big-endian encoding.

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.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

Encodes self into destination, returning the number of bytes written upon success.

Decodes a variable length value from source.

Encodes self into a new Vec<u8>.

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

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