Module spin_sdk.wit.imports.wasi_sockets_network_0_2_0
Classes
class ErrorCode (*args, **kwds)-
Expand source code
class ErrorCode(Enum): """ Error codes. In theory, every API can return any error code. In practice, API's typically only return the errors documented per API combined with a couple of errors that are always possible: - `unknown` - `access-denied` - `not-supported` - `out-of-memory` - `concurrency-conflict` See each individual API for what the POSIX equivalents are. They sometimes differ per API. """ UNKNOWN = 0 ACCESS_DENIED = 1 NOT_SUPPORTED = 2 INVALID_ARGUMENT = 3 OUT_OF_MEMORY = 4 TIMEOUT = 5 CONCURRENCY_CONFLICT = 6 NOT_IN_PROGRESS = 7 WOULD_BLOCK = 8 INVALID_STATE = 9 NEW_SOCKET_LIMIT = 10 ADDRESS_NOT_BINDABLE = 11 ADDRESS_IN_USE = 12 REMOTE_UNREACHABLE = 13 CONNECTION_REFUSED = 14 CONNECTION_RESET = 15 CONNECTION_ABORTED = 16 DATAGRAM_TOO_LARGE = 17 NAME_UNRESOLVABLE = 18 TEMPORARY_RESOLVER_FAILURE = 19 PERMANENT_RESOLVER_FAILURE = 20Error codes.
In theory, every API can return any error code. In practice, API's typically only return the errors documented per API combined with a couple of errors that are always possible: -
unknown-access-denied-not-supported-out-of-memory-concurrency-conflictSee each individual API for what the POSIX equivalents are. They sometimes differ per API.
Ancestors
- enum.Enum
Class variables
var ACCESS_DENIEDvar ADDRESS_IN_USEvar ADDRESS_NOT_BINDABLEvar CONCURRENCY_CONFLICTvar CONNECTION_ABORTEDvar CONNECTION_REFUSEDvar CONNECTION_RESETvar DATAGRAM_TOO_LARGEvar INVALID_ARGUMENTvar INVALID_STATEvar NAME_UNRESOLVABLEvar NEW_SOCKET_LIMITvar NOT_IN_PROGRESSvar NOT_SUPPORTEDvar OUT_OF_MEMORYvar PERMANENT_RESOLVER_FAILUREvar REMOTE_UNREACHABLEvar TEMPORARY_RESOLVER_FAILUREvar TIMEOUTvar UNKNOWNvar WOULD_BLOCK
class IpAddressFamily (*args, **kwds)-
Expand source code
class IpAddressFamily(Enum): IPV4 = 0 IPV6 = 1Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3Access 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 IPV4var IPV6
class IpAddress_Ipv4 (value: Tuple[int, int, int, int])-
Expand source code
@dataclass class IpAddress_Ipv4: value: Tuple[int, int, int, int]IpAddress_Ipv4(value: Tuple[int, int, int, int])
Instance variables
var value : Tuple[int, int, int, int]
class IpAddress_Ipv6 (value: Tuple[int, int, int, int, int, int, int, int])-
Expand source code
@dataclass class IpAddress_Ipv6: value: Tuple[int, int, int, int, int, int, int, int]IpAddress_Ipv6(value: Tuple[int, int, int, int, int, int, int, int])
Instance variables
var value : Tuple[int, int, int, int, int, int, int, int]
class IpSocketAddress_Ipv4 (value: Ipv4SocketAddress)-
Expand source code
@dataclass class IpSocketAddress_Ipv4: value: Ipv4SocketAddressIpSocketAddress_Ipv4(value: spin_sdk.wit.imports.wasi_sockets_network_0_2_0.Ipv4SocketAddress)
Instance variables
var value : Ipv4SocketAddress
class IpSocketAddress_Ipv6 (value: Ipv6SocketAddress)-
Expand source code
@dataclass class IpSocketAddress_Ipv6: value: Ipv6SocketAddressIpSocketAddress_Ipv6(value: spin_sdk.wit.imports.wasi_sockets_network_0_2_0.Ipv6SocketAddress)
Instance variables
var value : Ipv6SocketAddress
class Ipv4SocketAddress (port: int, address: Tuple[int, int, int, int])-
Expand source code
@dataclass class Ipv4SocketAddress: port: int address: Tuple[int, int, int, int]Ipv4SocketAddress(port: int, address: Tuple[int, int, int, int])
Instance variables
var address : Tuple[int, int, int, int]var port : int
class Ipv6SocketAddress (port: int,
flow_info: int,
address: Tuple[int, int, int, int, int, int, int, int],
scope_id: int)-
Expand source code
@dataclass class Ipv6SocketAddress: port: int flow_info: int address: Tuple[int, int, int, int, int, int, int, int] scope_id: intIpv6SocketAddress(port: int, flow_info: int, address: Tuple[int, int, int, int, int, int, int, int], scope_id: int)
Instance variables
var address : Tuple[int, int, int, int, int, int, int, int]var flow_info : intvar port : intvar scope_id : int
class Network-
Expand source code
class Network: """ An opaque resource that represents access to (a subset of) the network. This enables context-based security for networking. There is no need for this to map 1:1 to a physical network interface. """ def __enter__(self) -> Self: """Returns self""" return self def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None: """ Release this resource. """ raise NotImplementedErrorAn opaque resource that represents access to (a subset of) the network. This enables context-based security for networking. There is no need for this to map 1:1 to a physical network interface.