MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / add_question

Function add_question

ch_05/src/routes/question.rs:49–60  ·  view source on GitHub ↗
(
    store: Store,
    question: Question,
)

Source from the content-addressed store, hash-verified

47}
48
49pub async fn add_question(
50 store: Store,
51 question: Question,
52) -> Result<impl warp::Reply, warp::Rejection> {
53 store
54 .questions
55 .write()
56 .await
57 .insert(question.clone().id, question);
58
59 Ok(warp::reply::with_status("Question added", StatusCode::OK))
60}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected