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

Class AccountMessage

projects/Python/proto/proto.py:3376–3457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3374
3375@functools.total_ordering
3376class AccountMessage(object):
3377 __slots__ = "body",
3378
3379 def __init__(self, body=None):
3380 if body is None:
3381 body = Account()
3382 self.body = body
3383
3384 # Struct shallow copy
3385 def copy(self, other):
3386 self.body = other.body
3387 return self
3388
3389 # Struct deep clone
3390 def clone(self):
3391 # Serialize the struct to the FBE stream
3392 writer = AccountMessageModel(fbe.WriteBuffer())
3393 writer.serialize(self)
3394
3395 # Deserialize the struct from the FBE stream
3396 reader = AccountMessageModel(fbe.ReadBuffer())
3397 reader.attach_buffer(writer.buffer)
3398 return reader.deserialize()[0]
3399
3400 def __eq__(self, other):
3401 if not isinstance(self, other.__class__):
3402 return NotImplemented
3403 return True
3404
3405 def __lt__(self, other):
3406 if not isinstance(self, other.__class__):
3407 return NotImplemented
3408 return False
3409
3410 @property
3411 def __key__(self):
3412 return ()
3413
3414 def __hash__(self):
3415 return hash(self.__key__)
3416
3417 def __format__(self, format_spec):
3418 return self.__str__()
3419
3420 def __str__(self):
3421 sb = list()
3422 sb.append("AccountMessage(")
3423 sb.append("body=")
3424 sb.append(str(self.body))
3425 sb.append(")")
3426 return "".join(sb)
3427
3428 # Get struct JSON value
3429 def to_json(self):
3430 return json.dumps(self.__to_json__(), cls=fbe.JSONEncoder, separators=(',', ':'))
3431
3432 def __to_json__(self):
3433 result = dict()

Callers 7

__from_json__Method · 0.70
getMethod · 0.70
deserializeMethod · 0.70
getMethod · 0.70
deserializeMethod · 0.70
__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected