mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix(storage): make BaseStorage real abstract
This commit is contained in:
parent
00e3543cc3
commit
685cc0c3d9
1 changed files with 10 additions and 1 deletions
|
|
@ -1,27 +1,36 @@
|
|||
import abc
|
||||
|
||||
from typing import Generic, Optional, TypeVar
|
||||
|
||||
_DataT = TypeVar("_DataT")
|
||||
|
||||
|
||||
class BaseStorage(Generic[_DataT]):
|
||||
class BaseStorage(Generic[_DataT], abc.ABC):
|
||||
@abc.abstractmethod
|
||||
async def get_state(self, key: str) -> Optional[str]:
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
async def set_state(self, key: str, state: Optional[str]) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
async def get_data(self, key: str) -> _DataT:
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
async def set_data(self, key: str, data: Optional[_DataT]) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
async def update_data(self, key: str, data: _DataT) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
async def close(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
async def wait_closed(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue