Skip to main content

Module storage

Module storage 

Source
Expand description

存储 provider(spec §3.9 / §6.5 storage.*,0.2 新增)。

插件实现 Storage trait,经 register! { storage: MyType } 接入; 宿主在每次调用里传入该数据源的 config——插件应视自己为无状态(每次调用新实例)。 本版一个 register! 只挂一个 Storage 类型:即使 manifest 声明多个 [[contributes.storage]],也由同一类型按 config 自行区分(params.storage 不参与路由)。

Structs§

ItemStat
条目文件元信息(对齐宿主 storage::ItemStat)。

Traits§

Storage
存储后端 trait,8 方法镜像宿主 StorageBackend(语义约定见 spec §6.5): delete_* 幂等(不存在视为成功);init_new 建根 + .resource/ + 默认 info.json。

Functions§

dispatch_storage
storage.* 方法路由(register! 生成的 dispatch 调用)。 非 storage. 前缀返回 None,让调用方继续尝试其它方法族。