From f9d9f1f1826daa25f29ba618f98d2a0cf9ea28b6 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Tue, 10 Jun 2025 10:39:12 +0200 Subject: [PATCH] fix: make `Transaction` private For the time being, it is better to hide the `Transaction` type since actions might need to stay fine-grained. --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0060dc8..e1b58aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -679,7 +679,7 @@ where } /// Apply COB operations to a `JobMut`. - pub fn transaction( + fn transaction( &mut self, message: &str, signer: &Device, @@ -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(store::Transaction); +struct Transaction(store::Transaction); impl From> for Transaction 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 }) } }