pub struct KafkaUuid(/* private fields */);Expand description
128-bit UUID with Kafka-specific encoding semantics.
Implementations§
Source§impl KafkaUuid
impl KafkaUuid
Sourcepub const MAX_BASE64_LEN: usize = 24
pub const MAX_BASE64_LEN: usize = 24
Maximum length of a base64 representation (16 bytes → 22 chars + slack).
Sourcepub const MAX_RANDOM_RETRIES: u32 = 64
pub const MAX_RANDOM_RETRIES: u32 = 64
Maximum retries for Self::random before giving up.
Sourcepub const ONE: Self
pub const ONE: Self
UUID with value 1. Reserved — never returned by Self::random.
Sourcepub const METADATA_TOPIC_ID: Self = Self::ONE
pub const METADATA_TOPIC_ID: Self = Self::ONE
Metadata topic ID in KRaft mode (alias for Self::ONE).
Sourcepub const fn from_uuid(inner: Uuid) -> Self
pub const fn from_uuid(inner: Uuid) -> Self
Wrap a raw uuid::Uuid.
Sourcepub const fn from_parts(msb: u64, lsb: u64) -> Self
pub const fn from_parts(msb: u64, lsb: u64) -> Self
Construct from two 64-bit halves (most-significant first).
Sourcepub fn random() -> Result<Self>
pub fn random() -> Result<Self>
Generate a random non-reserved type-4 UUID whose base64 form does not
start with -. Returns UuidError::RandomExhausted if no candidate
is found within Self::MAX_RANDOM_RETRIES attempts.
Sourcepub const fn inner(&self) -> &Uuid
pub const fn inner(&self) -> &Uuid
Borrow the inner uuid::Uuid.
Sourcepub const fn most_significant_bits(self) -> u64
pub const fn most_significant_bits(self) -> u64
Most-significant 64 bits.
Sourcepub const fn least_significant_bits(self) -> u64
pub const fn least_significant_bits(self) -> u64
Least-significant 64 bits.
Sourcepub const fn is_reserved(self) -> bool
pub const fn is_reserved(self) -> bool
true for Self::ZERO and Self::ONE.
Sourcepub fn from_base64(s: &str) -> Result<Self>
pub fn from_base64(s: &str) -> Result<Self>
Parse from a base64 URL-safe string (no padding).
Trait Implementations§
impl Copy for KafkaUuid
impl Eq for KafkaUuid
Source§impl Ord for KafkaUuid
impl Ord for KafkaUuid
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for KafkaUuid
impl PartialOrd for KafkaUuid
impl StructuralPartialEq for KafkaUuid
Auto Trait Implementations§
impl Freeze for KafkaUuid
impl RefUnwindSafe for KafkaUuid
impl Send for KafkaUuid
impl Sync for KafkaUuid
impl Unpin for KafkaUuid
impl UnsafeUnpin for KafkaUuid
impl UnwindSafe for KafkaUuid
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