MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / clone

Method clone

projects/Python/proto/test.py:15613–15621  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15611
15612 # Struct deep clone
15613 def clone(self):
15614 # Serialize the struct to the FBE stream
15615 writer = StructEmptyModel(fbe.WriteBuffer())
15616 writer.serialize(self)
15617
15618 # Deserialize the struct from the FBE stream
15619 reader = StructEmptyModel(fbe.ReadBuffer())
15620 reader.attach_buffer(writer.buffer)
15621 return reader.deserialize()[0]
15622
15623 def __eq__(self, other):
15624 if not isinstance(self, other.__class__):

Callers

nothing calls this directly

Calls 4

serializeMethod · 0.95
deserializeMethod · 0.95
StructEmptyModelClass · 0.70
attach_bufferMethod · 0.45

Tested by

no test coverage detected