unpacker
Classes:
-
UnpackedValue–Describes where and how to store a value.
-
UnpackedValueStream–Describes where and how to store a stream.
-
Unpacker–A base for classes that decompose storable objects into their constituent parts.
Attributes:
-
AnyUnpackedValue–A type that can be either a value or a stream of values.
AnyUnpackedValue
module-attribute
AnyUnpackedValue = (
UnpackedValue[Any] | UnpackedValueStream[Any]
)
A type that can be either a value or a stream of values.
UnpackedValue
Bases: Generic[T], TypedDict
Describes where and how to store a value.
Attributes:
-
serializer(Serializer[T] | None) –The serializer to apply to the value.
-
storage(Storage | None) –The storage to send the serialized value to.
-
value(Required[T]) –The value to store.
serializer
instance-attribute
serializer: Serializer[T] | None
The serializer to apply to the value.
UnpackedValueStream
Bases: Generic[T], TypedDict
Describes where and how to store a stream.
Attributes:
-
serializer(StreamSerializer[T] | None) –The serializer to apply to the stream.
-
storage(Storage | None) –The storage to send the serialized stream to.
-
value_stream(Required[AsyncIterable[T]]) –The stream of data to store.
serializer
instance-attribute
serializer: StreamSerializer[T] | None
The serializer to apply to the stream.
value_stream
instance-attribute
value_stream: Required[AsyncIterable[T]]
The stream of data to store.
Unpacker
Bases: Generic[S, D], Component
A base for classes that decompose storable objects into their constituent parts.
Methods:
-
repack_object–Reconstitute the object from a mapping of its unpacked contents.
-
unpack_object–Return a mapping of that describes where and how to store the object's contents.
Attributes:
-
name(LiteralString) –The globally unique name of the component.
repack_object
abstractmethod
Reconstitute the object from a mapping of its unpacked contents.
unpack_object
abstractmethod
unpack_object(obj: S, registry: Registry) -> D
Return a mapping of that describes where and how to store the object's contents.