mirror of
https://seed.radicle.dev/rad:z2UcCU1LgMshWvXj6hXSDDrwB8q8M.git
synced 2026-10-18 19:30:30 +08:00
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:
+5
-5
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user