oxur_repl/client.rs
1//! REPL Client (Stub)
2//!
3//! This is a placeholder stub for the old ReplClient API.
4//! The new architecture uses TCP-based client/server (see server/mod.rs and transport/mod.rs).
5//!
6//! This stub exists only to satisfy external dependencies until they are updated
7//! to use the new architecture.
8
9use crate::Result;
10
11/// Stub REPL client for backwards compatibility.
12///
13/// **Note:** This is a placeholder. Use the TCP-based client architecture instead.
14/// See `crates/oxur-repl/src/transport/tcp.rs` for the actual client implementation.
15#[derive(Debug, Default)]
16pub struct ReplClient {
17 _placeholder: (),
18}
19
20impl ReplClient {
21 /// Creates a new stub REPL client.
22 pub fn new() -> Self {
23 Self { _placeholder: () }
24 }
25
26 /// Runs the REPL (stub - not implemented).
27 ///
28 /// # Errors
29 ///
30 /// Always returns an error indicating this is a stub.
31 pub fn run(&mut self) -> Result<()> {
32 Err(crate::Error::Protocol(
33 "ReplClient is a stub. Use the TCP-based server/client architecture instead."
34 .to_string(),
35 ))
36 }
37}
38
39#[cfg(test)]
40mod tests {
41 use super::*;
42
43 #[test]
44 fn test_new_client() {
45 let _client = ReplClient::new();
46 }
47
48 #[test]
49 fn test_run_returns_error() {
50 let mut client = ReplClient::new();
51 assert!(client.run().is_err());
52 }
53}