Struct CqlVarintBorrowed

Source
pub struct CqlVarintBorrowed<'b>(/* private fields */);
Expand description

A borrowed version of native CQL varint representation.

Refer to the documentation of CqlVarint. Especially, see the disclaimer about non-normalized values.

Implementations§

Source§

impl<'b> CqlVarintBorrowed<'b>

Constructors from bytes

Source

pub fn from_signed_bytes_be_slice(digits: &'b [u8]) -> Self

Creates a CqlVarintBorrowed from a slice of bytes in two’s complement binary big-endian representation.

See: disclaimer about non-normalized values.

Source§

impl CqlVarintBorrowed<'_>

Conversion to bytes

Source

pub fn as_signed_bytes_be_slice(&self) -> &[u8]

Returns a slice of bytes in two’s complement binary big-endian representation.

Trait Implementations§

Source§

impl<'b> Clone for CqlVarintBorrowed<'b>

Source§

fn clone(&self) -> CqlVarintBorrowed<'b>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'b> Debug for CqlVarintBorrowed<'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'b, 'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlVarintBorrowed<'b>
where 'frame: 'b,

Source§

fn type_check(typ: &ColumnType<'_>) -> Result<(), TypeCheckError>

Checks that the column type matches what this type expects.
Source§

fn deserialize( typ: &'metadata ColumnType<'metadata>, v: Option<FrameSlice<'frame>>, ) -> Result<Self, DeserializationError>

Deserialize a column value from given serialized representation. Read more
Source§

impl Hash for CqlVarintBorrowed<'_>

Computes the hash of normalized CqlVarintBorrowed.

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl PartialEq for CqlVarintBorrowed<'_>

Compares two CqlVarintBorrowed values after normalization.

§Example

let non_normalized_bytes = &[0x00, 0x01];
let normalized_bytes = &[0x01];
assert_eq!(
    CqlVarintBorrowed::from_signed_bytes_be_slice(non_normalized_bytes),
    CqlVarintBorrowed::from_signed_bytes_be_slice(normalized_bytes)
);
Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SerializeValue for CqlVarintBorrowed<'_>

Source§

fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>

Serializes the value to given CQL type. Read more
Source§

impl<'b> Emptiable for CqlVarintBorrowed<'b>

Source§

impl<'b> Eq for CqlVarintBorrowed<'b>

Auto Trait Implementations§

§

impl<'b> Freeze for CqlVarintBorrowed<'b>

§

impl<'b> RefUnwindSafe for CqlVarintBorrowed<'b>

§

impl<'b> Send for CqlVarintBorrowed<'b>

§

impl<'b> Sync for CqlVarintBorrowed<'b>

§

impl<'b> Unpin for CqlVarintBorrowed<'b>

§

impl<'b> UnwindSafe for CqlVarintBorrowed<'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,