MCPcopy Create free account
hub / github.com/ElementsProject/lightning / encode

Method encode

plugins/src/codec.rs:59–66  ·  view source on GitHub ↗
(&mut self, line: T, buf: &mut BytesMut)

Source from the content-addressed store, hash-verified

57{
58 type Error = Error;
59 fn encode(&mut self, line: T, buf: &mut BytesMut) -> Result<(), Self::Error> {
60 let line = line.as_ref();
61 buf.reserve(line.len() + 2);
62 buf.put(line.as_bytes());
63 buf.put_u8(b'\n');
64 buf.put_u8(b'\n');
65 Ok(())
66 }
67}
68
69#[derive(Default)]

Callers 2

test_ml_encoderFunction · 0.45
test_json_codecFunction · 0.45

Calls 1

to_stringMethod · 0.45

Tested by 2

test_ml_encoderFunction · 0.36
test_json_codecFunction · 0.36