deephaven.plugin.object

class Exporter[source]

Bases: abc.ABC

The interface for creating new references during ObjectType.to_bytes.

abstract reference(object, allow_unknown_type=False, force_new=False)[source]

Gets the reference for object if it has already been created and force_new is False, otherwise creates a new one. If allow_unknown_type is False, and no type can be found, no reference will be created.

Return type

Optional[Reference]

class ObjectType[source]

Bases: deephaven.plugin.Plugin

An object type plugin. Useful for serializing custom objects between the server / client.

abstract is_type(object)[source]

Returns true if, and only if, the object is compatible with this object type.

Return type

bool

abstract property name

The name of the object type.

abstract to_bytes(exporter, object)[source]

Serializes object into bytes. Must only be called with a compatible object.

Return type

bytes

class Reference(index, type)[source]

Bases: object

A reference.

property index

The index, which is defined by the order in which references are created. May be used in the output stream to refer to the reference from the client.

property type

The type.