diff options
Diffstat (limited to 'crates/shirabe/src/installer/installer_interface.rs')
| -rw-r--r-- | crates/shirabe/src/installer/installer_interface.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/shirabe/src/installer/installer_interface.rs b/crates/shirabe/src/installer/installer_interface.rs index 3394f1e3..6edaddb7 100644 --- a/crates/shirabe/src/installer/installer_interface.rs +++ b/crates/shirabe/src/installer/installer_interface.rs @@ -29,22 +29,25 @@ pub trait InstallerInterface: std::fmt::Debug { prev_package: Option<PackageInterfaceHandle>, ) -> anyhow::Result<Option<PhpMixed>>; + // install/update/uninstall take the repository behind a RefCell: the concurrent operation + // chains share it, and implementations must borrow it only in synchronous sections (never + // across an await). async fn install( &self, - repo: &mut dyn InstalledRepositoryInterface, + repo: &std::cell::RefCell<&mut dyn InstalledRepositoryInterface>, package: PackageInterfaceHandle, ) -> anyhow::Result<Option<PhpMixed>>; async fn update( &self, - repo: &mut dyn InstalledRepositoryInterface, + repo: &std::cell::RefCell<&mut dyn InstalledRepositoryInterface>, initial: PackageInterfaceHandle, target: PackageInterfaceHandle, ) -> anyhow::Result<Option<PhpMixed>>; async fn uninstall( &self, - repo: &mut dyn InstalledRepositoryInterface, + repo: &std::cell::RefCell<&mut dyn InstalledRepositoryInterface>, package: PackageInterfaceHandle, ) -> anyhow::Result<Option<PhpMixed>>; |
