pub struct TokenTermKey(/* private fields */);Expand description
A tagged term key: zero plus UTF-8, or one plus big-endian UTF-16 containing unpaired units.
Scalar text has exactly one representation, including supplementary characters and the empty string. Byte ordering is the persistent vocabulary order; it is not linguistic collation. Field/table names remain separate key components.
Implementations§
Source§impl TokenTermKey
impl TokenTermKey
Sourcepub fn from_text_budgeted<E: From<MemoryError>>(
text: &str,
budget: &MemoryBudget,
poll: impl FnMut() -> Result<(), E>,
) -> Result<Budgeted<Self>, E>
pub fn from_text_budgeted<E: From<MemoryError>>( text: &str, budget: &MemoryBudget, poll: impl FnMut() -> Result<(), E>, ) -> Result<Budgeted<Self>, E>
Encode borrowed scalar text with a reserved complete key buffer and bounded callback checks.
Sourcepub fn from_term_budgeted<E: From<MemoryError>>(
term: &TokenTerm,
budget: &MemoryBudget,
poll: impl FnMut() -> Result<(), E>,
) -> Result<Budgeted<Self>, E>
pub fn from_term_budgeted<E: From<MemoryError>>( term: &TokenTerm, budget: &MemoryBudget, poll: impl FnMut() -> Result<(), E>, ) -> Result<Budgeted<Self>, E>
Preserve canonical scalar/raw identity while reserving the key alongside its source term.
Sourcepub fn clone_budgeted<E: From<MemoryError>>(
&self,
budget: &MemoryBudget,
poll: impl FnMut() -> Result<(), E>,
) -> Result<Budgeted<Self>, E>
pub fn clone_budgeted<E: From<MemoryError>>( &self, budget: &MemoryBudget, poll: impl FnMut() -> Result<(), E>, ) -> Result<Budgeted<Self>, E>
Copy a validated key into a separately reserved buffer without reinterpreting its bytes.
Source§impl TokenTermKey
impl TokenTermKey
pub fn from_text(text: &str) -> Self
pub fn from_term(term: &TokenTerm) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> StorageBackendResult<Self>
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Borrow scalar text when this key contains a valid Unicode string.
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn to_term(&self) -> TokenTerm
Trait Implementations§
Source§impl Clone for TokenTermKey
impl Clone for TokenTermKey
Source§fn clone(&self) -> TokenTermKey
fn clone(&self) -> TokenTermKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenTermKey
impl Debug for TokenTermKey
impl Eq for TokenTermKey
Source§impl From<&str> for TokenTermKey
impl From<&str> for TokenTermKey
Source§impl From<String> for TokenTermKey
impl From<String> for TokenTermKey
Source§impl Hash for TokenTermKey
impl Hash for TokenTermKey
Source§impl Ord for TokenTermKey
impl Ord for TokenTermKey
Source§fn cmp(&self, other: &TokenTermKey) -> Ordering
fn cmp(&self, other: &TokenTermKey) -> Ordering
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for TokenTermKey
impl PartialEq for TokenTermKey
Source§impl PartialOrd for TokenTermKey
impl PartialOrd for TokenTermKey
impl StructuralPartialEq for TokenTermKey
Auto Trait Implementations§
impl Freeze for TokenTermKey
impl RefUnwindSafe for TokenTermKey
impl Send for TokenTermKey
impl Sync for TokenTermKey
impl Unpin for TokenTermKey
impl UnsafeUnpin for TokenTermKey
impl UnwindSafe for TokenTermKey
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