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

Function read_data

ra-rpc/src/rocket_helper.rs:323–330  ·  view source on GitHub ↗
(data: Data<'_>, limit: ByteUnit)

Source from the content-addressed store, hash-verified

321}
322
323async fn read_data(data: Data<'_>, limit: ByteUnit) -> Result<Vec<u8>> {
324 let stream = data.open(limit);
325 let data = stream.into_bytes().await.context("failed to read data")?;
326 if !data.is_complete() {
327 anyhow::bail!("payload too large");
328 }
329 Ok(data.into_inner())
330}
331
332fn limit_for_method(method: &str, limits: &Limits) -> ByteUnit {
333 if let Some(v) = limits.get(method) {

Callers 1

handle_prpc_implFunction · 0.85

Calls 1

into_innerMethod · 0.80

Tested by 1

handle_prpc_implFunction · 0.68