MCPcopy Create free account
hub / github.com/hashintel/hash / Payload

Class Payload

libs/@local/harpc/wire-protocol/src/payload.rs:9–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8#[cfg_attr(test, derive(test_strategy::Arbitrary))]
9pub struct Payload(
10 // 1024 ensures that we spill over into the second length byte while still having a good
11 // runtime performance.
12 #[cfg_attr(
13 test,
14 any(proptest::collection::size_range(0..1024).lift()),
15 map(|bytes: Vec<u8>| Bytes::from(bytes))
16 )]
17 Bytes,
18);
19
20impl Payload {
21 pub const MAX_SIZE: usize = (u16::MAX as usize) - 32;

Callers 1

encodeFunction · 0.70

Calls

no outgoing calls

Tested by 1

encodeFunction · 0.56