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
impl<'b> CqlVarintBorrowed<'b>
Constructors from bytes
Sourcepub fn from_signed_bytes_be_slice(digits: &'b [u8]) -> CqlVarintBorrowed<'b>
pub fn from_signed_bytes_be_slice(digits: &'b [u8]) -> CqlVarintBorrowed<'b>
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
impl CqlVarintBorrowed<'_>
Conversion to bytes
Sourcepub fn as_signed_bytes_be_slice(&self) -> &[u8] ⓘ
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>
impl<'b> Clone for CqlVarintBorrowed<'b>
Source§fn clone(&self) -> CqlVarintBorrowed<'b>
fn clone(&self) -> CqlVarintBorrowed<'b>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'b> Debug for CqlVarintBorrowed<'b>
impl<'b> Debug for CqlVarintBorrowed<'b>
Source§impl<'b, 'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlVarintBorrowed<'b>where
'frame: 'b,
impl<'b, 'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlVarintBorrowed<'b>where
'frame: 'b,
Source§fn type_check(typ: &ColumnType<'_>) -> Result<(), TypeCheckError>
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<CqlVarintBorrowed<'b>, DeserializationError>
fn deserialize( typ: &'metadata ColumnType<'metadata>, v: Option<FrameSlice<'frame>>, ) -> Result<CqlVarintBorrowed<'b>, DeserializationError>
Deserialize a column value from given serialized representation. Read more
Source§impl Hash for CqlVarintBorrowed<'_>
Computes the hash of normalized CqlVarintBorrowed
.
impl Hash for CqlVarintBorrowed<'_>
Computes the hash of normalized CqlVarintBorrowed
.
Source§impl PartialEq for CqlVarintBorrowed<'_>
Compares two CqlVarintBorrowed
values after normalization.
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§impl SerializeValue for CqlVarintBorrowed<'_>
impl SerializeValue for CqlVarintBorrowed<'_>
Source§fn serialize<'b>(
&self,
typ: &ColumnType<'_>,
writer: CellWriter<'b>,
) -> Result<WrittenCellProof<'b>, SerializationError>
fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>
Serializes the value to given CQL type. Read more
impl<'b> Emptiable for CqlVarintBorrowed<'b>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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