Skip to content

Str

Str

[De]serialize a string with a fixed length N using the syntax Str[N]. Use the syntax Str[N]._0[Encoding.UTF8, Encoding.ASCII] to specify a main and optionally a second fallback encoding (UTF8 and ASCII are defaults)

__class_getitem__ classmethod

__class_getitem__(item: int | Encoding | tuple[Encoding, Encoding]) -> type

from_bytes classmethod

from_bytes(bytes_: bytes, ver: Version = Version(0)) -> str

from_file classmethod

from_file(filepath: str) -> str

from_stream classmethod

from_stream(value: ByteStream, ver: Version = Version(0)) -> str

to_bytes classmethod

to_bytes(value: str) -> bytes

to_file classmethod

to_file(filepath: str, value: str)

str8

Bases: Str

[De]serialize a string whose length is indicated by a leading u8. Use the syntax str8._0[Encoding.UTF8, Encoding.ASCII] to specify a main and optionally a second fallback encoding (UTF8 and ASCII are defaults)

str16

Bases: Str

[De]serialize a string whose length is indicated by a leading u16. Use the syntax str16._0[Encoding.UTF8, Encoding.ASCII] to specify a main and optionally a second fallback encoding (UTF8 and ASCII are defaults)

str32

Bases: Str

[De]serialize a string whose length is indicated by a leading u32. Use the syntax str32._0[Encoding.UTF8, Encoding.ASCII] to specify a main and optionally a second fallback encoding (UTF8 and ASCII are defaults)

str64

Bases: Str

[De]serialize a string whose length is indicated by a leading u64. Use the syntax str64._0[Encoding.UTF8, Encoding.ASCII] to specify a main and optionally a second fallback encoding (UTF8 and ASCII are defaults)

str128

Bases: Str

[De]serialize a string whose length is indicated by a leading u128. Use the syntax str128._0[Encoding.UTF8, Encoding.ASCII] to specify a main and optionally a second fallback encoding (UTF8 and ASCII are defaults)