radicle: generic Transaction::initial
The use of Transaction outside of the radicle crate requires that a newtype is used, if the upstream code wants to write methods, such as:
pub struct Transaction<R>(store::Transaction<MyCob, R>);
impl Transaction<R> {
pub fn add_foo(&mut self, foo: Foo) -> Result<(), store::Error> { /* code */ }
pub fn add_bar(&mut self, bar: Bar) -> Result<(), store::Error> { /* code */ }}
This works up until the point that it tries to re-use the
Transaction::initial method.
To make this possible, the method needs to know that it can be
converted to the upstream Transaction and back to radicle
Transaction.
1 file changed
+6
-3
170915ff
→
dd5f7396
modified radicle/src/cob/store.rs
@@ -314,20 +314,23 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
|
|
|
|
|