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

Method clone

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

Source from the content-addressed store, hash-verified

7418
7419 # Struct deep clone
7420 def clone(self):
7421 # Serialize the struct to the FBE stream
7422 writer = StructNestedModel(fbe.WriteBuffer())
7423 writer.serialize(self)
7424
7425 # Deserialize the struct from the FBE stream
7426 reader = StructNestedModel(fbe.ReadBuffer())
7427 reader.attach_buffer(writer.buffer)
7428 return reader.deserialize()[0]
7429
7430 def __eq__(self, other):
7431 if not isinstance(self, other.__class__):

Callers

nothing calls this directly

Calls 4

serializeMethod · 0.95
deserializeMethod · 0.95
StructNestedModelClass · 0.70
attach_bufferMethod · 0.45

Tested by

no test coverage detected