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
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
impl PartialOrd<Signed> for Signed
impl PartialOrd<Signed> for Signed
pub fn partial_cmp(&self, other: &Signed) -> Option<Ordering>
pub fn partial_cmp(&self, other: &Signed) -> Option<Ordering>
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
Encodes self
into destination
, returning the number of bytes written upon success.
pub fn decode_variable<R>(input: R) -> Result<Signed, Error> where
R: Read,
pub fn decode_variable<R>(input: R) -> Result<Signed, Error> where
R: Read,
Decodes a variable length value from source
.
impl StructuralEq for Signed
impl StructuralPartialEq for Signed
Auto Trait Implementations
impl RefUnwindSafe for Signed
impl UnwindSafe for Signed
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
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