pub struct CollationRegistry { /* private fields */ }Expand description
Registry for collation functions, keyed by case-insensitive name.
Pre-populated with the three built-in collations: BINARY, NOCASE, RTRIM.
Custom collations can be registered via CollationRegistry::register.
Implementations§
Source§impl CollationRegistry
impl CollationRegistry
Sourcepub fn register<C: CollationFunction + 'static>(
&mut self,
collation: C,
) -> Option<Arc<dyn CollationFunction>>
pub fn register<C: CollationFunction + 'static>( &mut self, collation: C, ) -> Option<Arc<dyn CollationFunction>>
Register a custom collation. Returns the previous collation with the same name if one existed (overwrites).
Collation names are case-insensitive.
Sourcepub fn register_captured<C: CollationFunction + 'static>(
&mut self,
name: &str,
collation: C,
) -> Option<Arc<dyn CollationFunction>>
pub fn register_captured<C: CollationFunction + 'static>( &mut self, name: &str, collation: C, ) -> Option<Arc<dyn CollationFunction>>
Register a custom collation using a caller-captured name.
This variant never invokes user code. Callers that publish into a
shared registry can capture CollationFunction::name before taking
their lock, preventing a reentrant metadata callback from deadlocking.
Sourcepub fn find(&self, name: &str) -> Option<Arc<dyn CollationFunction>>
pub fn find(&self, name: &str) -> Option<Arc<dyn CollationFunction>>
Look up a collation by name (case-insensitive).
Returns None if no collation with the given name is registered.
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
Check whether a collation with the given name is registered.
Sourcepub fn uses_builtin_implementation(&self, name: &str) -> bool
pub fn uses_builtin_implementation(&self, name: &str) -> bool
Whether name currently resolves to FrankenSQLite’s built-in
implementation rather than an application override.
Fast paths that replace comparator calls with canonical byte keys must
use this stronger predicate: checking the name alone is unsound because
applications may replace even BINARY, NOCASE, or RTRIM.
Trait Implementations§
Source§impl Clone for CollationRegistry
impl Clone for CollationRegistry
Source§fn clone(&self) -> CollationRegistry
fn clone(&self) -> CollationRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more