pub struct NamespaceRegistry { /* private fields */ }Expand description
Registry tracking the namespace → database → table hierarchy.
Provides O(1) lookups and enforces naming constraints.
Implementations§
Source§impl NamespaceRegistry
impl NamespaceRegistry
Sourcepub fn create_namespace(
&mut self,
namespace: &str,
) -> Result<(), NamespaceError>
pub fn create_namespace( &mut self, namespace: &str, ) -> Result<(), NamespaceError>
Register a namespace (idempotent).
Sourcepub fn create_database(
&mut self,
namespace: &str,
database: &str,
) -> Result<(), NamespaceError>
pub fn create_database( &mut self, namespace: &str, database: &str, ) -> Result<(), NamespaceError>
Create a database within a namespace.
Sourcepub fn create_table(
&mut self,
namespace: &str,
database: &str,
table: &str,
) -> Result<(), NamespaceError>
pub fn create_table( &mut self, namespace: &str, database: &str, table: &str, ) -> Result<(), NamespaceError>
Register a table within a namespace/database.
Sourcepub fn list_databases(&self, namespace: &str) -> Vec<&str>
pub fn list_databases(&self, namespace: &str) -> Vec<&str>
List databases in a namespace.
Sourcepub fn list_tables(&self, namespace: &str, database: &str) -> Vec<&str>
pub fn list_tables(&self, namespace: &str, database: &str) -> Vec<&str>
List tables in a database.
Sourcepub fn namespace_exists(&self, namespace: &str) -> bool
pub fn namespace_exists(&self, namespace: &str) -> bool
Check if a namespace exists.
Sourcepub fn database_exists(&self, namespace: &str, database: &str) -> bool
pub fn database_exists(&self, namespace: &str, database: &str) -> bool
Check if a database exists within a namespace.
Sourcepub fn table_exists(&self, namespace: &str, database: &str, table: &str) -> bool
pub fn table_exists(&self, namespace: &str, database: &str, table: &str) -> bool
Check if a table exists within a namespace/database.
Sourcepub fn drop_database(&mut self, namespace: &str, database: &str) -> bool
pub fn drop_database(&mut self, namespace: &str, database: &str) -> bool
Drop a database and all its tables.
Sourcepub fn drop_table(
&mut self,
namespace: &str,
database: &str,
table: &str,
) -> bool
pub fn drop_table( &mut self, namespace: &str, database: &str, table: &str, ) -> bool
Drop a table from a database.
Sourcepub fn drop_namespace(&mut self, namespace: &str) -> bool
pub fn drop_namespace(&mut self, namespace: &str) -> bool
Drop a namespace and all its databases/tables.
Sourcepub fn resolve_table(&self, qualified: &QualifiedTable) -> bool
pub fn resolve_table(&self, qualified: &QualifiedTable) -> bool
Resolve a qualified table path to check it exists.
Trait Implementations§
Source§impl Clone for NamespaceRegistry
impl Clone for NamespaceRegistry
Source§fn clone(&self) -> NamespaceRegistry
fn clone(&self) -> NamespaceRegistry
Returns a duplicate of the value. Read more
1.0.0 · 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 NamespaceRegistry
impl Debug for NamespaceRegistry
Source§impl Default for NamespaceRegistry
impl Default for NamespaceRegistry
Source§fn default() -> NamespaceRegistry
fn default() -> NamespaceRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NamespaceRegistry
impl RefUnwindSafe for NamespaceRegistry
impl Send for NamespaceRegistry
impl Sync for NamespaceRegistry
impl Unpin for NamespaceRegistry
impl UnsafeUnpin for NamespaceRegistry
impl UnwindSafe for NamespaceRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more