latest.ipv8.messaging.payload_dataclass

Module Contents

Functions

type_from_format(→ TypeVar)

Convert a Serializer format directive to a type usable with @dataclass.

dataclass(...)

Equivalent to @dataclass, but also makes the wrapped class a VariablePayload.

latest.ipv8.messaging.payload_dataclass.type_from_format(fmt: str) TypeVar

Convert a Serializer format directive to a type usable with @dataclass.

latest.ipv8.messaging.payload_dataclass.dataclass(cls: type | None = None, *, init: bool = True, repr: bool = True, eq: bool = True, order: bool = False, unsafe_hash: bool = False, frozen: bool = False, msg_id: int | None = None) functools.partial[Type[latest.ipv8.messaging.lazy_payload.VariablePayload]] | Type[latest.ipv8.messaging.lazy_payload.VariablePayload]

Equivalent to @dataclass, but also makes the wrapped class a VariablePayload.

See dataclasses.dataclass for argument descriptions.