pub struct GrpcClient { /* private fields */ }Expand description
gRPC v2 client for interacting with the reovim server.
Wraps all service clients (Input, State, Buffer, Server, Presence, Debug) and provides a unified interface.
§Phase #479: Client ID Management
The client auto-joins the presence session on first use and stores the assigned
client_id. All subsequent calls use this ID for per-client state isolation.
Implementations§
Source§impl GrpcClient
impl GrpcClient
Sourcepub async fn connect(addr: &str) -> Result<Self, GrpcClientError>
pub async fn connect(addr: &str) -> Result<Self, GrpcClientError>
Sourcepub async fn send_keys(
&mut self,
keys: &str,
) -> Result<SendKeysResponse, GrpcClientError>
pub async fn send_keys( &mut self, keys: &str, ) -> Result<SendKeysResponse, GrpcClientError>
Send keys to the editor.
§Arguments
keys- Keys in vim notation (e.g.,iHello<Esc>).
§Returns
The response containing success status and key status.
§Errors
Returns an error if the gRPC call fails.
§Phase #479: Auto-join and panic on error
The client auto-joins the presence session on first call. Panics if joining fails or if the server returns a fatal error.
Sourcepub async fn get_mode(&mut self) -> Result<GetModeResponse, GrpcClientError>
pub async fn get_mode(&mut self) -> Result<GetModeResponse, GrpcClientError>
Sourcepub async fn get_mode_for_client(
&mut self,
client_id: u64,
) -> Result<GetModeResponse, GrpcClientError>
pub async fn get_mode_for_client( &mut self, client_id: u64, ) -> Result<GetModeResponse, GrpcClientError>
Sourcepub async fn get_cursor(&mut self) -> Result<GetCursorResponse, GrpcClientError>
pub async fn get_cursor(&mut self) -> Result<GetCursorResponse, GrpcClientError>
Sourcepub async fn get_cursor_for_client(
&mut self,
client_id: u64,
) -> Result<GetCursorResponse, GrpcClientError>
pub async fn get_cursor_for_client( &mut self, client_id: u64, ) -> Result<GetCursorResponse, GrpcClientError>
Sourcepub async fn list_buffers(
&mut self,
) -> Result<ListBuffersResponse, GrpcClientError>
pub async fn list_buffers( &mut self, ) -> Result<ListBuffersResponse, GrpcClientError>
Sourcepub async fn get_buffer_content(
&mut self,
buffer_id: Option<u64>,
) -> Result<GetRawContentResponse, GrpcClientError>
pub async fn get_buffer_content( &mut self, buffer_id: Option<u64>, ) -> Result<GetRawContentResponse, GrpcClientError>
Sourcepub async fn ping(&mut self) -> Result<PingResponse, GrpcClientError>
pub async fn ping(&mut self) -> Result<PingResponse, GrpcClientError>
Sourcepub async fn info(&mut self) -> Result<InfoResponse, GrpcClientError>
pub async fn info(&mut self) -> Result<InfoResponse, GrpcClientError>
Sourcepub async fn get_registers(
&mut self,
names: Vec<String>,
) -> Result<GetRegistersResponse, GrpcClientError>
pub async fn get_registers( &mut self, names: Vec<String>, ) -> Result<GetRegistersResponse, GrpcClientError>
Sourcepub async fn get_screen_content(
&mut self,
client_id: u64,
format: &str,
) -> Result<GetScreenContentResponse, GrpcClientError>
pub async fn get_screen_content( &mut self, client_id: u64, format: &str, ) -> Result<GetScreenContentResponse, GrpcClientError>
Get screen content via TUI capture relay.
Requests a screen capture from a specific TUI client via the server.
§Arguments
client_id- Target client ID to capture fromformat- Capture format:plain_text,raw_ansi, orcell_grid
§Errors
Returns an error if the gRPC call fails, no TUI is connected, or capture times out.
Sourcepub async fn presence_join(
&mut self,
client_type: &str,
display_name: &str,
) -> Result<JoinResponse, GrpcClientError>
pub async fn presence_join( &mut self, client_type: &str, display_name: &str, ) -> Result<JoinResponse, GrpcClientError>
Join the presence session.
Registers this client with the session and receives an assigned client ID.
§Arguments
client_type- Client type identifier (“cli”, “tui”, “web”, “test”).display_name- User-friendly display name.
§Returns
The response containing assigned client ID and list of connected peers.
§Errors
Returns an error if the gRPC call fails.
Sourcepub async fn presence_leave(&mut self) -> Result<LeaveResponse, GrpcClientError>
pub async fn presence_leave(&mut self) -> Result<LeaveResponse, GrpcClientError>
Sourcepub async fn presence_list(
&mut self,
) -> Result<ListClientsResponse, GrpcClientError>
pub async fn presence_list( &mut self, ) -> Result<ListClientsResponse, GrpcClientError>
Sourcepub async fn presence_update(
&mut self,
buffer_id: Option<u64>,
mode: Option<String>,
) -> Result<UpdatePresenceResponse, GrpcClientError>
pub async fn presence_update( &mut self, buffer_id: Option<u64>, mode: Option<String>, ) -> Result<UpdatePresenceResponse, GrpcClientError>
Sourcepub async fn presence_set_sync_mode(
&mut self,
sync_mode: i32,
follow_target: Option<u64>,
) -> Result<SetSyncModeResponse, GrpcClientError>
pub async fn presence_set_sync_mode( &mut self, sync_mode: i32, follow_target: Option<u64>, ) -> Result<SetSyncModeResponse, GrpcClientError>
Sourcepub async fn log_tail(
&mut self,
count: u32,
level: Option<String>,
target: Option<String>,
grep: Option<String>,
) -> Result<LogTailResponse, GrpcClientError>
pub async fn log_tail( &mut self, count: u32, level: Option<String>, target: Option<String>, grep: Option<String>, ) -> Result<LogTailResponse, GrpcClientError>
Get recent log entries from the server ring buffer.
§Arguments
count- Number of entries to retrieve (default: 50).level- Optional level filter (trace, debug, info, warn, error).target- Optional target module filter (contains match).grep- Optional message filter (case-insensitive contains).
§Returns
The response containing log entries.
§Errors
Returns an error if the gRPC call fails.
Sourcepub async fn debug_send_keys(
&mut self,
keys: &str,
target_client_id: u64,
) -> Result<DebugSendKeysResponse, GrpcClientError>
pub async fn debug_send_keys( &mut self, keys: &str, target_client_id: u64, ) -> Result<DebugSendKeysResponse, GrpcClientError>
Send keys to a specific client’s state via DebugService.
No auth required — CLI targets the client by ID directly.
§Errors
Returns an error if the gRPC call fails or target client doesn’t exist.
Sourcepub async fn debug_capture(
&mut self,
target_client_id: u64,
format: &str,
) -> Result<DebugCaptureResponse, GrpcClientError>
pub async fn debug_capture( &mut self, target_client_id: u64, format: &str, ) -> Result<DebugCaptureResponse, GrpcClientError>
Capture a specific client’s screen content via DebugService.
No auth required — CLI targets the client by ID directly.
§Errors
Returns an error if the gRPC call fails, client doesn’t exist, or capture times out.
Sourcepub async fn debug_get_mode(
&mut self,
target_client_id: u64,
) -> Result<DebugGetModeResponse, GrpcClientError>
pub async fn debug_get_mode( &mut self, target_client_id: u64, ) -> Result<DebugGetModeResponse, GrpcClientError>
Get a specific client’s current editor mode via DebugService.
No auth required — CLI targets the client by ID directly.
§Errors
Returns an error if the gRPC call fails or target client doesn’t exist.
Sourcepub async fn debug_get_cursor(
&mut self,
target_client_id: u64,
) -> Result<DebugGetCursorResponse, GrpcClientError>
pub async fn debug_get_cursor( &mut self, target_client_id: u64, ) -> Result<DebugGetCursorResponse, GrpcClientError>
Get a specific client’s cursor position via DebugService.
No auth required — CLI targets the client by ID directly.
§Errors
Returns an error if the gRPC call fails or target client doesn’t exist.
Sourcepub async fn debug_list_clients(
&mut self,
) -> Result<DebugListClientsResponse, GrpcClientError>
pub async fn debug_list_clients( &mut self, ) -> Result<DebugListClientsResponse, GrpcClientError>
List connected clients via DebugService.
No auth required — read-only debug query.
§Errors
Returns an error if the gRPC call fails.
Sourcepub async fn debug_get_extension_state(
&mut self,
kind: &str,
target_client_id: u64,
) -> Result<DebugGetExtensionStateResponse, GrpcClientError>
pub async fn debug_get_extension_state( &mut self, kind: &str, target_client_id: u64, ) -> Result<DebugGetExtensionStateResponse, GrpcClientError>
Query extension state for a specific client via DebugService.
No auth required — CLI targets the client by ID directly.
§Errors
Returns an error if the gRPC call fails or extension kind is unknown.
Sourcepub async fn debug_list_extensions(
&mut self,
) -> Result<DebugListExtensionsResponse, GrpcClientError>
pub async fn debug_list_extensions( &mut self, ) -> Result<DebugListExtensionsResponse, GrpcClientError>
List all registered extensions via DebugService.
No auth required — read-only debug query.
§Errors
Returns an error if the gRPC call fails.
Auto Trait Implementations§
impl !Freeze for GrpcClient
impl !RefUnwindSafe for GrpcClient
impl Send for GrpcClient
impl Sync for GrpcClient
impl Unpin for GrpcClient
impl UnsafeUnpin for GrpcClient
impl !UnwindSafe for GrpcClient
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request