mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
Extended role list
This commit is contained in:
parent
e0c11a09fb
commit
1ecfcc92d2
4 changed files with 107 additions and 21 deletions
|
@ -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)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue