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

Function add_question

ch_06/src/routes/question.rs:55–66  ·  view source on GitHub ↗
(
    store: Store,
    question: Question,
)

Source from the content-addressed store, hash-verified

53}
54
55pub async fn add_question(
56 store: Store,
57 question: Question,
58) -> Result<impl warp::Reply, warp::Rejection> {
59 store
60 .questions
61 .write()
62 .await
63 .insert(question.clone().id, question);
64
65 Ok(warp::reply::with_status("Question added", StatusCode::OK))
66}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected