mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-31 12:23:40 +00:00
add put
This commit is contained in:
@@ -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>
|
impl<T> From<JsonPointer> for Model<T>
|
||||||
where
|
where
|
||||||
T: Serialize + for<'de> Deserialize<'de>,
|
T: Serialize + for<'de> Deserialize<'de>,
|
||||||
|
|||||||
Reference in New Issue
Block a user