This commit is contained in:
Aiden McClelland
2021-04-26 15:41:08 -06:00
committed by Aiden McClelland
parent 6094a4bb1c
commit 8128321f0d

View File

@@ -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>,