ListLocalStorage 类
项列表的本地存储实现。
构造函数
ListLocalStorage(items: List[V] | None = None)
参数
| 名称 | 说明 |
|---|---|
|
items
|
默认值: None
|
方法
| append | |
| async_append | |
| async_clear | |
| async_delete | |
| async_filter | |
| async_get | |
| async_items | |
| async_length | |
| async_pop | |
| async_set | |
| clear | |
| delete | |
| filter | |
| get | |
| items | |
| length | |
| pop | |
| set |
append
append(value: V) -> None
参数
| 名称 | 说明 |
|---|---|
|
value
必需
|
|
async_append
async async_append(value: V) -> None
参数
| 名称 | 说明 |
|---|---|
|
value
必需
|
|
async_clear
async async_clear() -> None
async_delete
async async_delete(key: int) -> None
参数
| 名称 | 说明 |
|---|---|
|
key
必需
|
|
async_filter
async async_filter(predicate: Callable[[V, int], bool]) -> List[V]
参数
| 名称 | 说明 |
|---|---|
|
predicate
必需
|
|
async_get
async async_get(key: int) -> V | None
参数
| 名称 | 说明 |
|---|---|
|
key
必需
|
|
async_items
async async_items() -> List[V]
async_length
async async_length() -> int
async_pop
async async_pop() -> V | None
async_set
async async_set(key: int, value: V) -> None
参数
| 名称 | 说明 |
|---|---|
|
key
必需
|
|
|
value
必需
|
|
clear
clear() -> None
delete
delete(key: int) -> None
参数
| 名称 | 说明 |
|---|---|
|
key
必需
|
|
filter
filter(predicate: Callable[[V, int], bool]) -> List[V]
参数
| 名称 | 说明 |
|---|---|
|
predicate
必需
|
|
get
get(key: int) -> V | None
参数
| 名称 | 说明 |
|---|---|
|
key
必需
|
|
items
items() -> List[V]
length
length() -> int
pop
pop() -> V | None
set
set(key: int, value: V) -> None
参数
| 名称 | 说明 |
|---|---|
|
key
必需
|
|
|
value
必需
|
|