pub enum CliClient {
Sqlite(Box<SqliteGraphBackend>),
}Expand description
CLI backend client supporting SQLite and V3 backends
Both variants box their payload so the enum stays pointer-sized
(8 bytes) instead of being bloated to ~1.2 KB by the V3 variant,
avoiding clippy::large_enum_variant. The CLI only ever holds
one CliClient at a time, so the extra heap indirection has no
measurable cost vs. paying for the largest variant on every value.
Variants§
Sqlite(Box<SqliteGraphBackend>)
Implementations§
Source§impl CliClient
impl CliClient
Sourcepub fn open(backend: BackendType, path: &Path) -> Result<Self>
pub fn open(backend: BackendType, path: &Path) -> Result<Self>
Open database with specified backend
Sourcepub fn open_in_memory(backend: BackendType) -> Result<Self>
pub fn open_in_memory(backend: BackendType) -> Result<Self>
Open in-memory database
Sourcepub fn backend(&self) -> &dyn GraphBackend
pub fn backend(&self) -> &dyn GraphBackend
Get backend trait object
Sourcepub fn sqlite_graph(&self) -> Option<&SqliteGraph>
pub fn sqlite_graph(&self) -> Option<&SqliteGraph>
Get SQLite graph reference (if SQLite backend)
Sourcepub fn sqlite_backend(&self) -> Option<&SqliteGraphBackend>
pub fn sqlite_backend(&self) -> Option<&SqliteGraphBackend>
Get SQLite backend reference (for Cypher queries)
Sourcepub fn backend_name(&self) -> &'static str
pub fn backend_name(&self) -> &'static str
Get backend name
Sourcepub fn node_count(&self) -> Result<usize>
pub fn node_count(&self) -> Result<usize>
Get node count
Auto Trait Implementations§
impl Freeze for CliClient
impl !RefUnwindSafe for CliClient
impl Send for CliClient
impl !Sync for CliClient
impl Unpin for CliClient
impl UnsafeUnpin for CliClient
impl !UnwindSafe for CliClient
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> 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