diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-10-24 18:24:04 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-10-24 18:24:04 +0800 |
| commit | ac71a819dd45090a2ee1054208fd027f05a8c36c (patch) | |
| tree | a0e1a83b9a9c048d9efa714a00ea8531d9a9bea0 /crates | |
| parent | b2c45bf5c16391917caccd703ac85b80c5c77cca (diff) | |
Fix some spelling issues.
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/vcs_actions/src/actions/local_actions.rs | 19 | ||||
| -rw-r--r-- | crates/vcs_actions/src/registry/server_registry.rs | 4 | ||||
| -rw-r--r-- | crates/vcs_data/src/data/local.rs | 2 |
3 files changed, 21 insertions, 4 deletions
diff --git a/crates/vcs_actions/src/actions/local_actions.rs b/crates/vcs_actions/src/actions/local_actions.rs index 55d014e..c19b8f0 100644 --- a/crates/vcs_actions/src/actions/local_actions.rs +++ b/crates/vcs_actions/src/actions/local_actions.rs @@ -29,7 +29,24 @@ pub async fn hello_world_action(ctx: ActionContext, _n: ()) -> Result<(), TcpTar #[action_gen] pub async fn set_upstream_vault_action( ctx: ActionContext, - upstream: SocketAddr, + _upstream: SocketAddr, ) -> Result<(), TcpTargetError> { + // Ensure the instance is available + let Some(instance) = ctx.instance() else { + return Err(TcpTargetError::NotFound( + "Connection Instance Lost.".to_string(), + )); + }; + + if ctx.is_local() { + // Invoke on local + // Send the message to the server + let _ = instance.lock().await.write_text("Hello World!").await; + } else if ctx.is_remote() { + // Read the message from the client + let read = instance.lock().await.read_text().await?; + info!("{}", read) + } + Ok(()) } diff --git a/crates/vcs_actions/src/registry/server_registry.rs b/crates/vcs_actions/src/registry/server_registry.rs index b449b68..3ecc103 100644 --- a/crates/vcs_actions/src/registry/server_registry.rs +++ b/crates/vcs_actions/src/registry/server_registry.rs @@ -1,9 +1,9 @@ use action_system::action_pool::ActionPool; -use crate::actions::local_actions::register_hello_world_action; +use crate::actions::local_actions::register_set_upstream_vault_action; pub fn server_action_pool() -> ActionPool { let mut pool = ActionPool::new(); - register_hello_world_action(&mut pool); + register_set_upstream_vault_action(&mut pool); pool } diff --git a/crates/vcs_data/src/data/local.rs b/crates/vcs_data/src/data/local.rs index 1c99832..c93bd2b 100644 --- a/crates/vcs_data/src/data/local.rs +++ b/crates/vcs_data/src/data/local.rs @@ -93,7 +93,7 @@ Without these credentials, the server will reject all access requests. } /// Setup local workspace in current directory - pub async fn setup_local_workspacecurrent_dir() -> Result<(), std::io::Error> { + pub async fn setup_local_workspace_current_dir() -> Result<(), std::io::Error> { Self::setup_local_workspace(current_dir()?).await?; Ok(()) } |
