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

Method clone

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

Source from the content-addressed store, hash-verified

12929
12930 # Struct deep clone
12931 def clone(self):
12932 # Serialize the struct to the FBE stream
12933 writer = StructMapModel(fbe.WriteBuffer())
12934 writer.serialize(self)
12935
12936 # Deserialize the struct from the FBE stream
12937 reader = StructMapModel(fbe.ReadBuffer())
12938 reader.attach_buffer(writer.buffer)
12939 return reader.deserialize()[0]
12940
12941 def __eq__(self, other):
12942 if not isinstance(self, other.__class__):

Callers

nothing calls this directly

Calls 4

serializeMethod · 0.95
deserializeMethod · 0.95
StructMapModelClass · 0.70
attach_bufferMethod · 0.45

Tested by

no test coverage detected