Module spin_sdk.wit.imports.fermyon_spin_key_value

Global variables

var Error

The set of errors which may be raised by functions in this interface

Functions

def close(store: int) ‑> None
Expand source code
def close(store: int) -> None:
    """
    Close the specified `store`.
    
    This has no effect if `store` is not a valid handle to an open store.
    """
    raise NotImplementedError

Close the specified store.

This has no effect if store is not a valid handle to an open store.

def delete(store: int, key: str) ‑> None
Expand source code
def delete(store: int, key: str) -> None:
    """
    Delete the tuple with the specified `key` from the specified `store`.
    
    `error::invalid-store` will be raised if `store` is not a valid handle
    to an open store.  No error is raised if a tuple did not previously
    exist for `key`.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_key_value.Error)`
    """
    raise NotImplementedError

Delete the tuple with the specified key from the specified store.

error::invalid-store will be raised if store is not a valid handle to an open store. No error is raised if a tuple did not previously exist for key.

Raises: componentize_py_types.Err(Error)

def exists(store: int, key: str) ‑> bool
Expand source code
def exists(store: int, key: str) -> bool:
    """
    Return whether a tuple exists for the specified `key` in the specified
    `store`.
    
    `error::invalid-store` will be raised if `store` is not a valid handle
    to an open store.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_key_value.Error)`
    """
    raise NotImplementedError

Return whether a tuple exists for the specified key in the specified store.

error::invalid-store will be raised if store is not a valid handle to an open store.

Raises: componentize_py_types.Err(Error)

def get(store: int, key: str) ‑> bytes
Expand source code
def get(store: int, key: str) -> bytes:
    """
    Get the value associated with the specified `key` from the specified
    `store`.
    
    `error::invalid-store` will be raised if `store` is not a valid handle
    to an open store, and `error::no-such-key` will be raised if there is no
    tuple for `key` in `store`.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_key_value.Error)`
    """
    raise NotImplementedError

Get the value associated with the specified key from the specified store.

error::invalid-store will be raised if store is not a valid handle to an open store, and error::no-such-key will be raised if there is no tuple for key in store.

Raises: componentize_py_types.Err(Error)

def get_keys(store: int) ‑> List[str]
Expand source code
def get_keys(store: int) -> List[str]:
    """
    Return a list of all the keys in the specified `store`.
    
    `error::invalid-store` will be raised if `store` is not a valid handle
    to an open store.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_key_value.Error)`
    """
    raise NotImplementedError

Return a list of all the keys in the specified store.

error::invalid-store will be raised if store is not a valid handle to an open store.

Raises: componentize_py_types.Err(Error)

def open(name: str) ‑> int
Expand source code
def open(name: str) -> int:
    """
    Open the store with the specified name.
    
    If `name` is "default", the default store is opened.  Otherwise,
    `name` must refer to a store defined and configured in a runtime
    configuration file supplied with the application.
    
    `error::no-such-store` will be raised if the `name` is not recognized.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_key_value.Error)`
    """
    raise NotImplementedError

Open the store with the specified name.

If name is "default", the default store is opened. Otherwise, name must refer to a store defined and configured in a runtime configuration file supplied with the application.

error::no-such-store will be raised if the name is not recognized.

Raises: componentize_py_types.Err(Error)

def set(store: int, key: str, value: bytes) ‑> None
Expand source code
def set(store: int, key: str, value: bytes) -> None:
    """
    Set the `value` associated with the specified `key` in the specified
    `store`, overwriting any existing value.
    
    `error::invalid-store` will be raised if `store` is not a valid handle
    to an open store.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_key_value.Error)`
    """
    raise NotImplementedError

Set the value associated with the specified key in the specified store, overwriting any existing value.

error::invalid-store will be raised if store is not a valid handle to an open store.

Raises: componentize_py_types.Err(Error)

Classes

class Error_AccessDenied
Expand source code
@dataclass
class Error_AccessDenied:
    pass

Error_AccessDenied()

class Error_InvalidStore
Expand source code
@dataclass
class Error_InvalidStore:
    pass

Error_InvalidStore()

class Error_Io (value: str)
Expand source code
@dataclass
class Error_Io:
    value: str

Error_Io(value: str)

Instance variables

var value : str
class Error_NoSuchKey
Expand source code
@dataclass
class Error_NoSuchKey:
    pass

Error_NoSuchKey()

class Error_NoSuchStore
Expand source code
@dataclass
class Error_NoSuchStore:
    pass

Error_NoSuchStore()

class Error_StoreTableFull
Expand source code
@dataclass
class Error_StoreTableFull:
    pass

Error_StoreTableFull()