Module wasmtime.bindgen.generated.imports.types

Classes

class DescriptorType (*args, **kwds)
Expand source code
class DescriptorType(Enum):
    UNKNOWN = 0
    BLOCK_DEVICE = 1
    CHARACTER_DEVICE = 2
    DIRECTORY = 3
    FIFO = 4
    SYMBOLIC_LINK = 5
    REGULAR_FILE = 6
    SOCKET = 7

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var BLOCK_DEVICE

The type of the None singleton.

var CHARACTER_DEVICE

The type of the None singleton.

var DIRECTORY

The type of the None singleton.

var FIFO

The type of the None singleton.

var REGULAR_FILE

The type of the None singleton.

var SOCKET

The type of the None singleton.

The type of the None singleton.

var UNKNOWN

The type of the None singleton.

class ErrorCode (*args, **kwds)
Expand source code
class ErrorCode(Enum):
    ACCESS = 0
    WOULD_BLOCK = 1
    ALREADY = 2
    BAD_DESCRIPTOR = 3
    BUSY = 4
    DEADLOCK = 5
    QUOTA = 6
    EXIST = 7
    FILE_TOO_LARGE = 8
    ILLEGAL_BYTE_SEQUENCE = 9
    IN_PROGRESS = 10
    INTERRUPTED = 11
    INVALID = 12
    IO = 13
    IS_DIRECTORY = 14
    LOOP = 15
    TOO_MANY_LINKS = 16
    MESSAGE_SIZE = 17
    NAME_TOO_LONG = 18
    NO_DEVICE = 19
    NO_ENTRY = 20
    NO_LOCK = 21
    INSUFFICIENT_MEMORY = 22
    INSUFFICIENT_SPACE = 23
    NOT_DIRECTORY = 24
    NOT_EMPTY = 25
    NOT_RECOVERABLE = 26
    UNSUPPORTED = 27
    NO_TTY = 28
    NO_SUCH_DEVICE = 29
    OVERFLOW = 30
    NOT_PERMITTED = 31
    PIPE = 32
    READ_ONLY = 33
    INVALID_SEEK = 34
    TEXT_FILE_BUSY = 35
    CROSS_DEVICE = 36

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

Color.RED

  • value lookup:

Color(1)

  • name lookup:

Color['RED']

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ancestors

  • enum.Enum

Class variables

var ACCESS

The type of the None singleton.

var ALREADY

The type of the None singleton.

var BAD_DESCRIPTOR

The type of the None singleton.

var BUSY

The type of the None singleton.

var CROSS_DEVICE

The type of the None singleton.

var DEADLOCK

The type of the None singleton.

var EXIST

The type of the None singleton.

var FILE_TOO_LARGE

The type of the None singleton.

var ILLEGAL_BYTE_SEQUENCE

The type of the None singleton.

var INSUFFICIENT_MEMORY

The type of the None singleton.

var INSUFFICIENT_SPACE

The type of the None singleton.

var INTERRUPTED

The type of the None singleton.

var INVALID

The type of the None singleton.

var INVALID_SEEK

The type of the None singleton.

var IN_PROGRESS

The type of the None singleton.

var IO

The type of the None singleton.

var IS_DIRECTORY

The type of the None singleton.

var LOOP

The type of the None singleton.

var MESSAGE_SIZE

The type of the None singleton.

var NAME_TOO_LONG

The type of the None singleton.

var NOT_DIRECTORY

The type of the None singleton.

var NOT_EMPTY

The type of the None singleton.

var NOT_PERMITTED

The type of the None singleton.

var NOT_RECOVERABLE

The type of the None singleton.

var NO_DEVICE

The type of the None singleton.

var NO_ENTRY

The type of the None singleton.

var NO_LOCK

The type of the None singleton.

var NO_SUCH_DEVICE

The type of the None singleton.

var NO_TTY

The type of the None singleton.

var OVERFLOW

The type of the None singleton.

var PIPE

The type of the None singleton.

var QUOTA

The type of the None singleton.

var READ_ONLY

The type of the None singleton.

var TEXT_FILE_BUSY

The type of the None singleton.

The type of the None singleton.

var UNSUPPORTED

The type of the None singleton.

var WOULD_BLOCK

The type of the None singleton.

class HostTypes (*args, **kwargs)
Expand source code
class HostTypes(Protocol):
    @abstractmethod
    def write_via_stream(self, this: Descriptor, offset: Filesize) -> Result[OutputStream, ErrorCode]:
        raise NotImplementedError
    @abstractmethod
    def append_via_stream(self, this: Descriptor) -> Result[OutputStream, ErrorCode]:
        raise NotImplementedError
    @abstractmethod
    def get_type(self, this: Descriptor) -> Result[DescriptorType, ErrorCode]:
        raise NotImplementedError
    @abstractmethod
    def drop_descriptor(self, this: Descriptor) -> None:
        raise NotImplementedError

Base class for protocol classes.

Protocol classes are defined as::

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example::

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as::

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...

Ancestors

  • typing.Protocol
  • typing.Generic

Subclasses

  • wasmtime.bindgen.WasiTypes

Methods

def append_via_stream(self, this: int) ‑> Ok[int] | Err[ErrorCode]
Expand source code
@abstractmethod
def append_via_stream(self, this: Descriptor) -> Result[OutputStream, ErrorCode]:
    raise NotImplementedError
def drop_descriptor(self, this: int) ‑> None
Expand source code
@abstractmethod
def drop_descriptor(self, this: Descriptor) -> None:
    raise NotImplementedError
def get_type(self, this: int) ‑> Ok[DescriptorType] | Err[ErrorCode]
Expand source code
@abstractmethod
def get_type(self, this: Descriptor) -> Result[DescriptorType, ErrorCode]:
    raise NotImplementedError
def write_via_stream(self, this: int, offset: int) ‑> Ok[int] | Err[ErrorCode]
Expand source code
@abstractmethod
def write_via_stream(self, this: Descriptor, offset: Filesize) -> Result[OutputStream, ErrorCode]:
    raise NotImplementedError