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

Method decode

cc-eventlog/src/codecs.rs:27–41  ·  view source on GitHub ↗
(input: &mut In)

Source from the content-addressed store, hash-verified

25 for VecOf<I, T, MAX_LEN>
26{
27 fn decode<In: Input>(input: &mut In) -> Result<Self, scale::Error> {
28 let decoded_len = I::decode(input)?;
29 let len = decoded_len.into() as usize;
30 if len > MAX_LEN {
31 return Err("VecOf length exceeds upper bound".into());
32 }
33 let mut inner = Vec::with_capacity(len.min(1024));
34 for _ in 0..len {
35 inner.push(T::decode(input)?);
36 }
37 Ok(Self {
38 len: decoded_len,
39 inner,
40 })
41 }
42}
43
44impl<I, T, const MAX_LEN: usize> VecOf<I, T, MAX_LEN> {

Callers

nothing calls this directly

Calls 1

decodeFunction · 0.85

Tested by

no test coverage detected