pub struct ReplEngine { /* private fields */ }Expand description
Main REPL engine
Implementations§
Source§impl ReplEngine
impl ReplEngine
Sourcepub fn new(
config: ReplConfig,
db_path: &Path,
app_config: Config,
database: Database,
) -> ReplResult<Self>
pub fn new( config: ReplConfig, db_path: &Path, app_config: Config, database: Database, ) -> ReplResult<Self>
Create a new REPL engine
Sourcepub fn with_schema_registry(
config: ReplConfig,
db_path: &Path,
app_config: Config,
database: Database,
schema_registry: Option<Arc<RwLock<SchemaRegistry>>>,
) -> ReplResult<Self>
pub fn with_schema_registry( config: ReplConfig, db_path: &Path, app_config: Config, database: Database, schema_registry: Option<Arc<RwLock<SchemaRegistry>>>, ) -> ReplResult<Self>
Create a new REPL engine with an optional pre-loaded SchemaRegistry
This is used when the CLI performs ingestion at startup, allowing
the REPL to have immediate access to schema information for commands
like :describe without needing to run :schema refresh first.
Sourcepub async fn run(&mut self) -> ReplResult<()>
pub async fn run(&mut self) -> ReplResult<()>
Start the REPL loop
Sourcepub fn process_input<'a>(
&'a mut self,
input: &'a str,
) -> Pin<Box<dyn Future<Output = ReplResult<ExecutionResult>> + 'a>>
pub fn process_input<'a>( &'a mut self, input: &'a str, ) -> Pin<Box<dyn Future<Output = ReplResult<ExecutionResult>> + 'a>>
Process a line of input
Sourcepub fn session(&self) -> &ReplSession
pub fn session(&self) -> &ReplSession
Get reference to session
Sourcepub fn session_mut(&mut self) -> &mut ReplSession
pub fn session_mut(&mut self) -> &mut ReplSession
Get mutable reference to session
Sourcepub fn config(&self) -> &ReplConfig
pub fn config(&self) -> &ReplConfig
Get current configuration
Sourcepub async fn rebuild_database_from_discovery(
&mut self,
data_dir: PathBuf,
schema_paths: Vec<PathBuf>,
version_hint: Option<String>,
) -> ReplResult<()>
pub async fn rebuild_database_from_discovery( &mut self, data_dir: PathBuf, schema_paths: Vec<PathBuf>, version_hint: Option<String>, ) -> ReplResult<()>
Rebuild Database from discovery when ingestion changes
This method orchestrates schema loading and SSTable discovery to create a new Database instance, replacing the existing one in the REPL session.
Use cases:
- After
:config data-dir <path>changes the data directory - After
:schema load <path>loads new schema files - After
:schema refreshreloads existing schemas
§Arguments
data_dir- Root data directory containing SSTablesschema_paths- Schema file paths (.cql or .json) to loadversion_hint- Optional Cassandra version hint (e.g., “5.0”)
§Errors
Returns ReplError::Database for ingestion failures, schema loading errors, or database initialization errors.
Auto Trait Implementations§
impl !RefUnwindSafe for ReplEngine
impl !UnwindSafe for ReplEngine
impl Freeze for ReplEngine
impl Send for ReplEngine
impl Sync for ReplEngine
impl Unpin for ReplEngine
impl UnsafeUnpin for ReplEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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