MCPcopy Create free account
hub / github.com/apache/iggy / WireEncode

Interface WireEncode

core/binary_protocol/src/codec.rs:26–40  ·  view source on GitHub ↗

Encode a wire type into a caller-owned buffer. Buffer-first design: the caller controls allocation. The `to_bytes()` convenience method allocates when needed, but hot paths can reuse buffers via `encode()` directly.

Source from the content-addressed store, hash-verified

24/// convenience method allocates when needed, but hot paths can reuse
25/// buffers via `encode()` directly.
26pub trait WireEncode {
27 /// Write the encoded representation into `buf`.
28 fn encode(&self, buf: &mut BytesMut);
29
30 /// Return the exact encoded size in bytes.
31 fn encoded_size(&self) -> usize;
32
33 /// Convenience: allocate a new [`Bytes`] and encode into it.
34 #[must_use]
35 fn to_bytes(&self) -> Bytes {
36 let mut buf = BytesMut::with_capacity(self.encoded_size());
37 self.encode(&mut buf);
38 buf.freeze()
39 }
40}
41
42/// Decode a wire type from a byte slice.
43///

Callers 8

roundtrip_numericFunction · 0.45
roundtrip_namedFunction · 0.45
roundtrip_numericFunction · 0.45
roundtrip_namedFunction · 0.45
encodeMethod · 0.45

Implementers 15

command.rscore/server/src/state/command.rs
models.rscore/server/src/state/models.rs
entry.rscore/server/src/state/entry.rs
get_user.rscore/binary_protocol/src/requests/user
delete_user.rscore/binary_protocol/src/requests/user
update_permissions.rscore/binary_protocol/src/requests/user
login_user.rscore/binary_protocol/src/requests/user
logout_user.rscore/binary_protocol/src/requests/user
login_register_with_pat.rscore/binary_protocol/src/requests/user
create_user.rscore/binary_protocol/src/requests/user
login_register.rscore/binary_protocol/src/requests/user
get_users.rscore/binary_protocol/src/requests/user

Calls

no outgoing calls

Tested by

no test coverage detected