pub struct CqlTimeuuid(/* private fields */);
Expand description
Represents timeuuid (uuid V1) value
This type has custom comparison logic which follows ScyllaDB/Cassandra semantics.
For details, see Ord
implementation.
Implementations§
Source§impl CqlTimeuuid
Uuid
delegate methods
impl CqlTimeuuid
Uuid
delegate methods
Sourcepub fn as_bytes(&self) -> &[u8; 16]
pub fn as_bytes(&self) -> &[u8; 16]
Returns byte representation of the CqlTimeuuid
.
See Uuid::as_bytes
for details.
Sourcepub fn as_u128(&self) -> u128
pub fn as_u128(&self) -> u128
Returns a u128
representation of the CqlTimeuuid
.
See Uuid::as_u128
for details.
Sourcepub fn as_fields(&self) -> (u32, u16, u16, &[u8; 8])
pub fn as_fields(&self) -> (u32, u16, u16, &[u8; 8])
Returns a representation of the CqlTimeuuid
as a list of its logical fields.
See Uuid::as_fields
for details.
Sourcepub fn as_u64_pair(&self) -> (u64, u64)
pub fn as_u64_pair(&self) -> (u64, u64)
Returns a representation of the CqlTimeuuid
as a pair of u64
values.
See Uuid::as_u64_pair
for details.
Sourcepub fn from_slice(b: &[u8]) -> Result<Self, Error>
pub fn from_slice(b: &[u8]) -> Result<Self, Error>
Creates a new CqlTimeuuid
from a big-endian byte representation.
See Uuid::from_slice
for details.
Sourcepub fn from_slice_le(b: &[u8]) -> Result<Self, Error>
pub fn from_slice_le(b: &[u8]) -> Result<Self, Error>
Creates a new CqlTimeuuid
from a little-endian byte representation.
See Uuid::from_slice_le
for details.
Sourcepub fn from_bytes(bytes: [u8; 16]) -> Self
pub fn from_bytes(bytes: [u8; 16]) -> Self
Creates a new CqlTimeuuid
from a big-endian byte representation.
See Uuid::from_bytes
for details.
Sourcepub fn from_bytes_le(bytes: [u8; 16]) -> Self
pub fn from_bytes_le(bytes: [u8; 16]) -> Self
Creates a new CqlTimeuuid
from a little-endian byte representation.
See Uuid::from_bytes_le
for details.
Sourcepub fn from_fields(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Self
pub fn from_fields(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Self
Creates a new CqlTimeuuid
from a big-endian byte representation of its fields.
See Uuid::from_fields
for details.
Sourcepub fn from_fields_le(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Self
pub fn from_fields_le(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Self
Creates a new CqlTimeuuid
from a little-endian byte representation of its fields.
See Uuid::from_fields_le
for details.
Sourcepub fn from_u128(v: u128) -> Self
pub fn from_u128(v: u128) -> Self
Creates a new CqlTimeuuid
from a big-endian u128
value.
See Uuid::from_u128
for details.
Sourcepub fn from_u128_le(v: u128) -> Self
pub fn from_u128_le(v: u128) -> Self
Creates a new CqlTimeuuid
from a little-endian u128
value.
See Uuid::from_u128_le
for details.
Sourcepub fn from_u64_pair(high_bits: u64, low_bits: u64) -> Self
pub fn from_u64_pair(high_bits: u64, low_bits: u64) -> Self
Creates a new CqlTimeuuid
from a pair of u64
values.
See Uuid::from_u64_pair
for details.
Trait Implementations§
Source§impl AsRef<Uuid> for CqlTimeuuid
impl AsRef<Uuid> for CqlTimeuuid
Source§impl Clone for CqlTimeuuid
impl Clone for CqlTimeuuid
Source§fn clone(&self) -> CqlTimeuuid
fn clone(&self) -> CqlTimeuuid
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CqlTimeuuid
impl Debug for CqlTimeuuid
Source§impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlTimeuuid
impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlTimeuuid
Source§fn type_check(typ: &ColumnType<'_>) -> Result<(), TypeCheckError>
fn type_check(typ: &ColumnType<'_>) -> Result<(), TypeCheckError>
Source§fn deserialize(
typ: &'metadata ColumnType<'metadata>,
v: Option<FrameSlice<'frame>>,
) -> Result<Self, DeserializationError>
fn deserialize( typ: &'metadata ColumnType<'metadata>, v: Option<FrameSlice<'frame>>, ) -> Result<Self, DeserializationError>
Source§impl Display for CqlTimeuuid
impl Display for CqlTimeuuid
Source§impl From<CqlTimeuuid> for Uuid
impl From<CqlTimeuuid> for Uuid
Source§fn from(value: CqlTimeuuid) -> Self
fn from(value: CqlTimeuuid) -> Self
Source§impl From<Uuid> for CqlTimeuuid
impl From<Uuid> for CqlTimeuuid
Source§impl FromStr for CqlTimeuuid
impl FromStr for CqlTimeuuid
Source§impl Hash for CqlTimeuuid
impl Hash for CqlTimeuuid
Source§impl Ord for CqlTimeuuid
Compare two values of timeuuid type.
impl Ord for CqlTimeuuid
Compare two values of timeuuid type.
Cassandra legacy requires:
- converting 8 most significant bytes to date, which is then compared.
- masking off UUID version from the 8 ms-bytes during compare, to treat possible non-version-1 UUID the same way as UUID.
- using signed compare for least significant bits.
Source§impl PartialEq for CqlTimeuuid
impl PartialEq for CqlTimeuuid
Source§impl PartialOrd for CqlTimeuuid
impl PartialOrd for CqlTimeuuid
Source§impl SerializeValue for CqlTimeuuid
impl SerializeValue for CqlTimeuuid
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>
impl Copy for CqlTimeuuid
impl Emptiable for CqlTimeuuid
impl Eq for CqlTimeuuid
Auto Trait Implementations§
impl Freeze for CqlTimeuuid
impl RefUnwindSafe for CqlTimeuuid
impl Send for CqlTimeuuid
impl Sync for CqlTimeuuid
impl Unpin for CqlTimeuuid
impl UnwindSafe for CqlTimeuuid
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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