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

Method push_bytes

libs/@local/harpc/wire-protocol/src/codec/buffer.rs:144–154  ·  view source on GitHub ↗
(&mut self, bytes: &Bytes)

Source from the content-addressed store, hash-verified

142 }
143
144 pub(crate) fn push_bytes(&mut self, bytes: &Bytes) -> Result<(), Report<BufferError>> {
145 if self.0.remaining_mut() < bytes.len() {
146 return Err(Report::new(BufferError::NotEnoughCapacity));
147 }
148
149 let cursor = Cursor::new(bytes);
150
151 self.0.put(cursor);
152
153 Ok(())
154 }
155
156 pub(crate) fn push_slice(&mut self, slice: &[u8]) -> Result<(), Report<BufferError>> {
157 if self.0.remaining_mut() < slice.len() {

Callers 3

pushFunction · 0.80
push_eofFunction · 0.80
encodeMethod · 0.80

Calls 3

ErrInterface · 0.85
OkInterface · 0.85
lenMethod · 0.45

Tested by 2

pushFunction · 0.64
push_eofFunction · 0.64