Skip to content

Class swarmauri_core.state.IState.IState

swarmauri_core.state.IState.IState

Bases: ABC

read abstractmethod

read()

Reads and returns the current state as a dictionary.

Source code in swarmauri_core/state/IState.py
 6
 7
 8
 9
10
@abstractmethod
def read(self) -> Dict[str, Any]:
    """
    Reads and returns the current state as a dictionary.
    """

write abstractmethod

write(data)

Replaces the current state with the given data.

Source code in swarmauri_core/state/IState.py
12
13
14
15
16
@abstractmethod
def write(self, data: Dict[str, Any]) -> None:
    """
    Replaces the current state with the given data.
    """

update abstractmethod

update(data)

Updates the state with the given data.

Source code in swarmauri_core/state/IState.py
18
19
20
21
22
@abstractmethod
def update(self, data: Dict[str, Any]) -> None:
    """
    Updates the state with the given data.
    """

reset abstractmethod

reset()

Resets the state to its initial state.

Source code in swarmauri_core/state/IState.py
24
25
26
27
28
@abstractmethod
def reset(self) -> None:
    """
    Resets the state to its initial state.
    """