MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / invoke

Function invoke

libatomic/tests/local_sync_test.rs:209–219  ·  view source on GitHub ↗
(
    service: &LocalService,
    method: &str,
    request: &Req,
)

Source from the content-addressed store, hash-verified

207}
208
209async fn invoke<Req: Message, Res: Message + Default>(
210 service: &LocalService,
211 method: &str,
212 request: &Req,
213) -> Res {
214 let bytes = service
215 .call(method, &request.encode_to_vec())
216 .await
217 .unwrap();
218 Res::decode(bytes.as_slice()).unwrap()
219}
220
221async fn resolve(service: &LocalService, path: &Path) -> proto::RepositoryRef {
222 let response: proto::ResolveRepositoryResponse = invoke(

Calls 4

decodeFunction · 0.50
unwrapMethod · 0.45
callMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected