pub struct CqlDecimalBorrowed<'b> { /* private fields */ }
Expand description
Borrowed version of native CQL decimal
representation.
Represented as a pair:
- a
CqlVarintBorrowed
value - 32-bit integer which determines the position of the decimal point
Refer to the documentation of CqlDecimal
.
Especially, see the disclaimer about non-normalized values.
Implementations§
Source§impl<'b> CqlDecimalBorrowed<'b>
Constructors
impl<'b> CqlDecimalBorrowed<'b>
Constructors
Sourcepub fn from_signed_be_bytes_slice_and_exponent(
bytes: &'b [u8],
scale: i32,
) -> CqlDecimalBorrowed<'b>
pub fn from_signed_be_bytes_slice_and_exponent( bytes: &'b [u8], scale: i32, ) -> CqlDecimalBorrowed<'b>
Creates a CqlDecimalBorrowed
from a slice of bytes
representing CqlVarintBorrowed
and a 32-bit scale.
See: disclaimer about non-normalized values.
Source§impl CqlDecimalBorrowed<'_>
Conversion to raw bytes
impl CqlDecimalBorrowed<'_>
Conversion to raw bytes
Sourcepub fn as_signed_be_bytes_slice_and_exponent(&self) -> (&[u8], i32)
pub fn as_signed_be_bytes_slice_and_exponent(&self) -> (&[u8], i32)
Returns a slice of bytes in two’s complement binary big-endian representation and a scale.
Trait Implementations§
Source§impl<'b> Clone for CqlDecimalBorrowed<'b>
impl<'b> Clone for CqlDecimalBorrowed<'b>
Source§fn clone(&self) -> CqlDecimalBorrowed<'b>
fn clone(&self) -> CqlDecimalBorrowed<'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 CqlDecimalBorrowed<'b>
impl<'b> Debug for CqlDecimalBorrowed<'b>
Source§impl<'b, 'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlDecimalBorrowed<'b>where
'frame: 'b,
impl<'b, 'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlDecimalBorrowed<'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<CqlDecimalBorrowed<'b>, DeserializationError>
fn deserialize( typ: &'metadata ColumnType<'metadata>, v: Option<FrameSlice<'frame>>, ) -> Result<CqlDecimalBorrowed<'b>, DeserializationError>
Deserialize a column value from given serialized representation. Read more
Source§impl<'b> PartialEq for CqlDecimalBorrowed<'b>
impl<'b> PartialEq for CqlDecimalBorrowed<'b>
Source§impl SerializeValue for CqlDecimalBorrowed<'_>
impl SerializeValue for CqlDecimalBorrowed<'_>
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 CqlDecimalBorrowed<'b>
impl<'b> Eq for CqlDecimalBorrowed<'b>
impl<'b> StructuralPartialEq for CqlDecimalBorrowed<'b>
Auto Trait Implementations§
impl<'b> Freeze for CqlDecimalBorrowed<'b>
impl<'b> RefUnwindSafe for CqlDecimalBorrowed<'b>
impl<'b> Send for CqlDecimalBorrowed<'b>
impl<'b> Sync for CqlDecimalBorrowed<'b>
impl<'b> Unpin for CqlDecimalBorrowed<'b>
impl<'b> UnwindSafe for CqlDecimalBorrowed<'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