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

Function add_answer

ch_07/src/routes/answer.rs:6–16  ·  view source on GitHub ↗
(
    store: Store,
    new_answer: NewAnswer,
)

Source from the content-addressed store, hash-verified

4use crate::types::answer::NewAnswer;
5
6pub async fn add_answer(
7 store: Store,
8 new_answer: NewAnswer,
9) -> Result<impl warp::Reply, warp::Rejection> {
10 match store.add_answer(new_answer).await {
11 Ok(_) => {
12 Ok(warp::reply::with_status("Answer added", StatusCode::OK))
13 }
14 Err(e) => Err(warp::reject::custom(e)),
15 }
16}

Callers

nothing calls this directly

Calls 1

add_answerMethod · 0.45

Tested by

no test coverage detected