MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / into_result

Method into_result

supervisor/src/web_api.rs:25–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23
24impl<T> Response<T> {
25 pub fn into_result(self) -> Result<T> {
26 match self {
27 Response::Data(data) => Ok(data),
28 Response::Error(e) => Err(anyhow!(e)),
29 }
30 }
31}
32
33fn to_json<T: Serialize>(r: Result<T>) -> Json<Response<T>> {

Callers 1

http_requestMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected