Skip to content

Option

Option

Bases: Generic[T]

This class cannot be used on its own. Use one of its subclasses

__class_getitem__ classmethod

__class_getitem__(item: Any) -> type

from_bytes classmethod

from_bytes(bytes_: bytes, ver: Version = Version(0)) -> T | None

from_file classmethod

from_file(filepath: str) -> T | None

from_stream classmethod

from_stream(value: ByteStream, ver: Version = Version(0)) -> T | None

to_bytes classmethod

to_bytes(value: T | None) -> bytes

to_file classmethod

to_file(filepath: str, value: T | None)

Option8

Bases: Option[T], Generic[T]

De[serialize] a type T only if the leading u8 is non-zero using the syntax Option8[T]

Option16

Bases: Option[T], Generic[T]

De[serialize] a type T only if the leading u16 is non-zero using the syntax Option16[T]

Option32

Bases: Option[T], Generic[T]

De[serialize] a type T only if the leading u32 is non-zero using the syntax Option32[T]

Option64

Bases: Option[T], Generic[T]

De[serialize] a type T only if the leading u64 is non-zero using the syntax Option64[T]

Option128

Bases: Option[T], Generic[T]

De[serialize] a type T only if the leading u128 is non-zero using the syntax Option128[T]