pub struct DialectRegistry { /* private fields */ }Expand description
Thread-safe registry for custom dialect plugins.
Access the singleton with DialectRegistry::global().
Implementations§
Source§impl DialectRegistry
impl DialectRegistry
Sourcepub fn global() -> &'static DialectRegistry
pub fn global() -> &'static DialectRegistry
Returns the global registry singleton.
Sourcepub fn register<P: DialectPlugin + 'static>(&self, plugin: P)
pub fn register<P: DialectPlugin + 'static>(&self, plugin: P)
Register a custom dialect plugin.
If a plugin with the same name already exists it is replaced.
Sourcepub fn get(&self, name: &str) -> Option<Arc<dyn DialectPlugin>>
pub fn get(&self, name: &str) -> Option<Arc<dyn DialectPlugin>>
Look up a custom dialect by name (case-insensitive).
Sourcepub fn unregister(&self, name: &str) -> bool
pub fn unregister(&self, name: &str) -> bool
Remove a custom dialect plugin by name.
Returns true if the dialect was found and removed.
Sourcepub fn registered_names(&self) -> Vec<String>
pub fn registered_names(&self) -> Vec<String>
Returns the names of all registered custom dialects.
Auto Trait Implementations§
impl !Freeze for DialectRegistry
impl RefUnwindSafe for DialectRegistry
impl Send for DialectRegistry
impl Sync for DialectRegistry
impl Unpin for DialectRegistry
impl UnsafeUnpin for DialectRegistry
impl UnwindSafe for DialectRegistry
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