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

Method clone

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

Source from the content-addressed store, hash-verified

8491
8492 # Struct deep clone
8493 def clone(self):
8494 # Serialize the struct to the FBE stream
8495 writer = StructBytesModel(fbe.WriteBuffer())
8496 writer.serialize(self)
8497
8498 # Deserialize the struct from the FBE stream
8499 reader = StructBytesModel(fbe.ReadBuffer())
8500 reader.attach_buffer(writer.buffer)
8501 return reader.deserialize()[0]
8502
8503 def __eq__(self, other):
8504 if not isinstance(self, other.__class__):

Callers

nothing calls this directly

Calls 4

serializeMethod · 0.95
deserializeMethod · 0.95
StructBytesModelClass · 0.70
attach_bufferMethod · 0.45

Tested by

no test coverage detected