外观
bus_types API
模块说明
text
Native declarations and lossless scalar values for the structural Bus codec.i8
python
i8 = Annotated[int, _Width('int', 8)]i16
python
i16 = Annotated[int, _Width('int', 16)]i32
python
i32 = Annotated[int, _Width('int', 32)]i64
python
i64 = Annotated[int, _Width('int', 64)]u8
python
u8 = Annotated[int, _Width('uint', 8)]u16
python
u16 = Annotated[int, _Width('uint', 16)]u32
python
u32 = Annotated[int, _Width('uint', 32)]u64
python
u64 = Annotated[int, _Width('uint', 64)]f32
python
f32 = Annotated[float, _Width('float', 32)]f64
python
f64 = Annotated[float, _Width('float', 64)]T
python
T = TypeVar('T')OptionalValue
python
@dataclass
class OptionalValue(Generic[T])SDK 说明:
text
Presence is independent of nullability: some(None) can be present.字段(包含继承字段):
OptionalValue.present
python
present: bool = False数据类字段;声明于 bus_types.OptionalValue。
OptionalValue.value
python
value: T | None = None数据类字段;声明于 bus_types.OptionalValue。
OptionalValue.some
python
@classmethod
def some(cls, value: T) -> OptionalValue[T]另继承外部类型 Generic[T];其通用方法不在本 SDK 目录中重复展开。
NullableValue
python
@dataclass
class NullableValue(Generic[T])SDK 说明:
text
An explicitly present nullable value, including a present inner null.
Ordinary non-null payloads need no wrapper. ``NullableValue(None)`` retains
the outer presence when the schema contains two nullable layers.字段(包含继承字段):
NullableValue.value
python
value: T数据类字段;声明于 bus_types.NullableValue。
另继承外部类型 Generic[T];其通用方法不在本 SDK 目录中重复展开。
FloatBits
python
@dataclass(frozen=True)
class FloatBitsSDK 说明:
text
IEEE bits preserved without converting signalling NaNs through float.字段(包含继承字段):
FloatBits.bits
python
bits: int数据类字段;声明于 bus_types.FloatBits。
FloatBits.width
python
width: int数据类字段;声明于 bus_types.FloatBits。
UnionValue
python
@dataclass
class UnionValueSDK 说明:
text
Select a union branch explicitly when Python runtime types overlap.
``annotation`` is the declared variant (for example ``i8``), or its
canonical node ID when using a binding generated from a schema.字段(包含继承字段):
UnionValue.annotation
python
annotation: Any数据类字段;声明于 bus_types.UnionValue。
UnionValue.value
python
value: Any数据类字段;声明于 bus_types.UnionValue。
NBT
python
@dataclass
class NBTSDK 说明:
text
An exact NBT tag and value; List (tag 9) also retains element_type.
Integer tags use Python ints, float tags use FloatBits or float, arrays use
lists of ints, Compound uses dict[str, NBT], and List uses list[NBT].字段(包含继承字段):
NBT.tag
python
tag: int数据类字段;声明于 bus_types.NBT。
NBT.value
python
value: Any数据类字段;声明于 bus_types.NBT。
NBT.element_type
python
element_type: int = 0数据类字段;声明于 bus_types.NBT。