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

Function add_question

ch_07/src/routes/question.rs:56–66  ·  view source on GitHub ↗
(
    store: Store,
    new_question: NewQuestion,
)

Source from the content-addressed store, hash-verified

54}
55
56pub async fn add_question(
57 store: Store,
58 new_question: NewQuestion,
59) -> Result<impl warp::Reply, warp::Rejection> {
60 match store.add_question(new_question).await {
61 Ok(_) => {
62 Ok(warp::reply::with_status("Question added", StatusCode::OK))
63 }
64 Err(e) => Err(warp::reject::custom(e)),
65 }
66}

Callers

nothing calls this directly

Calls 1

add_questionMethod · 0.45

Tested by

no test coverage detected