mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 10:21:53 +00:00
add put
This commit is contained in:
committed by
Aiden McClelland
parent
6094a4bb1c
commit
8128321f0d
@@ -84,6 +84,15 @@ where
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<T> Model<T>
|
||||
where
|
||||
T: Serialize + for<'de> Deserialize<'de> + Send + Sync,
|
||||
{
|
||||
pub async fn put<Tx: Checkpoint>(&self, tx: &mut Tx, value: &T) -> Result<(), Error> {
|
||||
self.lock(tx, LockType::Write).await;
|
||||
tx.put(&self.ptr, value).await
|
||||
}
|
||||
}
|
||||
impl<T> From<JsonPointer> for Model<T>
|
||||
where
|
||||
T: Serialize + for<'de> Deserialize<'de>,
|
||||
|
||||
Reference in New Issue
Block a user