Extended role list

This commit is contained in:
Natsu Kagami 2021-02-10 17:57:19 +09:00 committed by Natsu Kagami
parent e0c11a09fb
commit 1ecfcc92d2
4 changed files with 107 additions and 21 deletions

View file

@ -23,6 +23,11 @@ impl<T: std::any::Any + Default + Send + Sync + Clone + Serialize + std::fmt::De
where
for<'de> T: Deserialize<'de>,
{
/// Load the DB from a path.
pub fn load_from_path(path: impl AsRef<Path>) -> Result<Database<T>, DBError> {
Ok(Database::<T>::load_from_path(path)?)
}
/// Insert into a ShareMap.
pub fn insert_into(data: &mut TypeMap, path: impl AsRef<Path>) -> Result<(), DBError> {
let db = Database::<T>::load_from_path_or_default(path)?;