pub struct EntityKeyBuilder(/* private fields */);Expand description
Builder for a v1 canonical entity key.
Implementations§
Source§impl EntityKeyBuilder
impl EntityKeyBuilder
Sourcepub fn new(entity_type: EntityTypeId) -> Self
pub fn new(entity_type: EntityTypeId) -> Self
Starts an entity key with its purpose namespace, version, and entity type.
Sourcepub fn push_bool(&mut self, value: bool) -> Result<&mut Self, KeyEncodingError>
pub fn push_bool(&mut self, value: bool) -> Result<&mut Self, KeyEncodingError>
Appends a canonical Boolean component.
Sourcepub fn push_u32(&mut self, value: u32) -> Result<&mut Self, KeyEncodingError>
pub fn push_u32(&mut self, value: u32) -> Result<&mut Self, KeyEncodingError>
Appends an unsigned 32-bit ordered component.
Sourcepub fn push_u64(&mut self, value: u64) -> Result<&mut Self, KeyEncodingError>
pub fn push_u64(&mut self, value: u64) -> Result<&mut Self, KeyEncodingError>
Appends an unsigned 64-bit ordered component.
Sourcepub fn push_i32(&mut self, value: i32) -> Result<&mut Self, KeyEncodingError>
pub fn push_i32(&mut self, value: i32) -> Result<&mut Self, KeyEncodingError>
Appends a signed 32-bit component whose bytes preserve numeric order.
Sourcepub fn push_i64(&mut self, value: i64) -> Result<&mut Self, KeyEncodingError>
pub fn push_i64(&mut self, value: i64) -> Result<&mut Self, KeyEncodingError>
Appends a signed 64-bit component whose bytes preserve numeric order.
Sourcepub fn push_timestamp(
&mut self,
value: Timestamp,
) -> Result<&mut Self, KeyEncodingError>
pub fn push_timestamp( &mut self, value: Timestamp, ) -> Result<&mut Self, KeyEncodingError>
Appends a canonical timestamp component.
Sourcepub fn push_date(&mut self, value: Date) -> Result<&mut Self, KeyEncodingError>
pub fn push_date(&mut self, value: Date) -> Result<&mut Self, KeyEncodingError>
Appends a canonical date component.
Sourcepub fn push_enum_variant(
&mut self,
value: EnumVariantId,
) -> Result<&mut Self, KeyEncodingError>
pub fn push_enum_variant( &mut self, value: EnumVariantId, ) -> Result<&mut Self, KeyEncodingError>
Appends a canonical declared-enum variant component.
Sourcepub fn push_uuid(
&mut self,
value: &[u8; 16],
) -> Result<&mut Self, KeyEncodingError>
pub fn push_uuid( &mut self, value: &[u8; 16], ) -> Result<&mut Self, KeyEncodingError>
Appends fixed-width UUID network-order bytes.
Sourcepub fn push_bytes(
&mut self,
value: &[u8],
) -> Result<&mut Self, KeyEncodingError>
pub fn push_bytes( &mut self, value: &[u8], ) -> Result<&mut Self, KeyEncodingError>
Appends a length-prefixed exact byte component.
Sourcepub fn push_str(&mut self, value: &str) -> Result<&mut Self, KeyEncodingError>
pub fn push_str(&mut self, value: &str) -> Result<&mut Self, KeyEncodingError>
Appends a length-prefixed exact UTF-8 component without normalization.
Sourcepub fn push_ordered_bytes(
&mut self,
value: &[u8],
) -> Result<&mut Self, KeyEncodingError>
pub fn push_ordered_bytes( &mut self, value: &[u8], ) -> Result<&mut Self, KeyEncodingError>
Appends zero-escaped bytes whose encoded order preserves byte order.
Sourcepub fn push_ordered_bytes_prefix(
&mut self,
value: &[u8],
) -> Result<&mut Self, KeyEncodingError>
pub fn push_ordered_bytes_prefix( &mut self, value: &[u8], ) -> Result<&mut Self, KeyEncodingError>
Appends the non-terminated prefix of one ordered-byte component.
Sourcepub fn finish(self) -> Result<EntityKey, KeyEncodingError>
pub fn finish(self) -> Result<EntityKey, KeyEncodingError>
Finishes the bounded canonical entity key.