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

Method clone

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

Source from the content-addressed store, hash-verified

15061
15062 # Struct deep clone
15063 def clone(self):
15064 # Serialize the struct to the FBE stream
15065 writer = StructHashExModel(fbe.WriteBuffer())
15066 writer.serialize(self)
15067
15068 # Deserialize the struct from the FBE stream
15069 reader = StructHashExModel(fbe.ReadBuffer())
15070 reader.attach_buffer(writer.buffer)
15071 return reader.deserialize()[0]
15072
15073 def __eq__(self, other):
15074 if not isinstance(self, other.__class__):

Callers

nothing calls this directly

Calls 4

serializeMethod · 0.95
deserializeMethod · 0.95
StructHashExModelClass · 0.70
attach_bufferMethod · 0.45

Tested by

no test coverage detected