fix: make Transaction private

For the time being, it is better to hide the `Transaction` type since actions
might need to stay fine-grained.
This commit is contained in:
Fintan Halpenny
2025-06-10 10:47:26 +02:00
parent 24750667f0
commit f9d9f1f182
+5 -5
View File
@@ -679,7 +679,7 @@ where
}
/// Apply COB operations to a `JobMut`.
pub fn transaction<G, F>(
fn transaction<G, F>(
&mut self,
message: &str,
signer: &Device<G>,
@@ -701,7 +701,7 @@ where
/// An update for the `Job` COB. This applies a change to the
/// in-memory computed representation of the COB.
pub struct Transaction<R: ReadRepository>(store::Transaction<Job, R>);
struct Transaction<R: ReadRepository>(store::Transaction<Job, R>);
impl<R> From<store::Transaction<Job, R>> for Transaction<R>
where
@@ -755,17 +755,17 @@ where
R: ReadRepository,
{
/// Add a request operation to the transaction.
pub fn request(&mut self, oid: Oid) -> Result<(), store::Error> {
fn request(&mut self, oid: Oid) -> Result<(), store::Error> {
self.0.push(Action::Request { oid })
}
/// Add a new `Run` to a transaction.
pub fn run(&mut self, uuid: Uuid, log: Url) -> Result<(), store::Error> {
fn run(&mut self, uuid: Uuid, log: Url) -> Result<(), store::Error> {
self.0.push(Action::Run { uuid, log })
}
/// Mark a run as finished.
pub fn finish(&mut self, uuid: Uuid, reason: Reason) -> Result<(), store::Error> {
fn finish(&mut self, uuid: Uuid, reason: Reason) -> Result<(), store::Error> {
self.0.push(Action::Finished { uuid, reason })
}
}