MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / write_request

Method write_request

crates/opencode-plugin/src/subprocess/client.rs:445–459  ·  view source on GitHub ↗
(
        &self,
        id: u64,
        method: &str,
        params: Option<Value>,
    )

Source from the content-addressed store, hash-verified

443 }
444
445 async fn write_request(
446 &self,
447 id: u64,
448 method: &str,
449 params: Option<Value>,
450 ) -> Result<(), PluginSubprocessError> {
451 let request = RpcRequest::new(id, method, params);
452 let content = serde_json::to_string(&request)?;
453 let frame = format!("Content-Length: {}\r\n\r\n{}", content.len(), content);
454
455 let mut stdin = self.stdin.lock().await;
456 stdin.write_all(frame.as_bytes()).await?;
457 stdin.flush().await?;
458 Ok(())
459 }
460
461 async fn read_response_for_id(
462 &self,

Callers 2

auth_fetch_streamMethod · 0.80
callMethod · 0.80

Calls 1

newFunction · 0.85

Tested by

no test coverage detected