MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / set_conversation_by_path

Method set_conversation_by_path

crates/chat-cli/src/database/mod.rs:399–411  ·  view source on GitHub ↗

Set a chat conversation given a path to the conversation.

(
        &mut self,
        path: impl AsRef<Path>,
        state: &ConversationState,
    )

Source from the content-addressed store, hash-verified

397
398 /// Set a chat conversation given a path to the conversation.
399 pub fn set_conversation_by_path(
400 &mut self,
401 path: impl AsRef<Path>,
402 state: &ConversationState,
403 ) -> Result<usize, DatabaseError> {
404 // We would need to encode this to support non utf8 paths.
405 let path = match path.as_ref().to_str() {
406 Some(path) => path,
407 None => return Ok(0),
408 };
409
410 self.set_json_entry(Table::Conversations, path, state)
411 }
412
413 pub async fn get_secret(&self, key: &str) -> Result<Option<Secret>, DatabaseError> {
414 trace!(key, "getting secret");

Callers 1

Calls 2

set_json_entryMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected