pub struct IndexName { /* private fields */ }Expand description
Validated index identity with fixed-size persisted representation.
Used by index-store key domains as canonical index-name bytes.
Implementations§
Source§impl IndexName
impl IndexName
Sourcepub const STORED_SIZE_BYTES: u64
pub const STORED_SIZE_BYTES: u64
Fixed on-disk size in bytes (stable, protocol-level).
Sourcepub const STORED_SIZE_USIZE: usize
pub const STORED_SIZE_USIZE: usize
Fixed in-memory size (for buffers and arrays).
Sourcepub fn try_from_entity_fields(
entity: &EntityName,
fields: &[&str],
) -> Result<Self, IndexNameError>
pub fn try_from_entity_fields( entity: &EntityName, fields: &[&str], ) -> Result<Self, IndexNameError>
Validate and construct one non-unique index identity from an entity + field list.
Sourcepub fn try_unique_from_entity_fields(
entity: &EntityName,
fields: &[&str],
) -> Result<Self, IndexNameError>
pub fn try_unique_from_entity_fields( entity: &EntityName, fields: &[&str], ) -> Result<Self, IndexNameError>
Validate and construct one unique index identity from an entity + field list.
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Borrow raw index-identity bytes excluding trailing fixed-buffer padding.
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Borrow the index identity as UTF-8 text.
§Panics
Panics if the stored index-name bytes violate the ASCII-only identity invariant. Construction and decoding are expected to prevent this.
Sourcepub fn to_bytes(self) -> [u8; 492]
pub fn to_bytes(self) -> [u8; 492]
Encode this identity into its fixed-size persisted representation.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, IdentityDecodeError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, IdentityDecodeError>
Decode one fixed-size persisted index identity payload.
This validates the canonical fixed-width byte envelope only. It does not
reconstruct field segments or prove the bytes were produced by
try_from_entity_fields; callers must ensure persisted bytes originate from a
previously validated IndexName.