MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / emit_event

Method emit_event

sdk/rust/src/dstack_client.rs:184–192  ·  view source on GitHub ↗
(&self, event: String, payload: Vec<u8>)

Source from the content-addressed store, hash-verified

182 }
183
184 pub async fn emit_event(&self, event: String, payload: Vec<u8>) -> Result<()> {
185 if event.is_empty() {
186 anyhow::bail!("Event name cannot be empty")
187 }
188 let hex_payload = hex_encode(payload);
189 let data = json!({ "event": event, "payload": hex_payload });
190 self.send_rpc_request::<_, ()>("/EmitEvent", &data).await?;
191 Ok(())
192 }
193
194 pub async fn get_tls_key(&self, tls_key_config: TlsKeyConfig) -> Result<GetTlsKeyResponse> {
195 let response = self.send_rpc_request("/GetTlsKey", &tls_key_config).await?;

Callers 1

mainFunction · 0.45

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected