Struct GCSharedRuntimeManager
pub struct GCSharedRuntimeManager(Arc<RwLock<GCRuntimeManager>>);Tuple Fields§
§0: Arc<RwLock<GCRuntimeManager>>Implementations§
pub fn new( systemd_runner_enable: bool, config: &GCConfigDatabase, ) -> GCSharedRuntimeManager
pub async fn write(&self) -> RwLockWriteGuard<'_, GCRuntimeManager>
pub async fn read(&self) -> RwLockReadGuard<'_, GCRuntimeManager>
pub async fn owned_write(&self) -> OwnedRwLockWriteGuard<GCRuntimeManager>
pub async fn owned_write(&self) -> OwnedRwLockWriteGuard<GCRuntimeManager>
Usefull for sending across threads
pub async fn owned_read(&self) -> OwnedRwLockReadGuard<GCRuntimeManager>
pub async fn owned_read(&self) -> OwnedRwLockReadGuard<GCRuntimeManager>
Usefull for sending across threads
pub async fn stop_orphaned_runtimes(&self, config: &GCConfigDatabase)
pub async fn stop_orphaned_runtimes(&self, config: &GCConfigDatabase)
Stops all gc_runtime@* systemd services whose IDs are not present in the configuration.
pub async fn restart_all_runtimes(
&self,
) -> (Vec<String>, Vec<RestartRuntimeError>)
pub async fn restart_all_runtimes( &self, ) -> (Vec<String>, Vec<RestartRuntimeError>)
Restarts all connected runtimes in parallel.
pub async fn restart_runtime(
&self,
runtime_id: &str,
) -> Result<(), RestartRuntimeError>
pub async fn restart_runtime( &self, runtime_id: &str, ) -> Result<(), RestartRuntimeError>
Restarts a single runtime by ID.
Removes the handler from the manager before sending the restart command so the lock is not held during the HTTP call. The handler is put back if the restart fails.
Returns Ok(()) on success, Err(RestartRuntimeError::NotFound) if the runtime ID is
unknown, or Err(RestartRuntimeError::RestartFailed) if the command fails after retries.
pub async fn start_runtime(
&self,
runtime_id: &str,
) -> Result<(), StartRuntimeError>
pub async fn start_runtime( &self, runtime_id: &str, ) -> Result<(), StartRuntimeError>
Starts a disconnected runtime via systemctl start gc_runtime@<runtime_id>.
Trait Implementations§
§fn clone(&self) -> GCSharedRuntimeManager
fn clone(&self) -> GCSharedRuntimeManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more