Struct GCRuntimeManager
pub struct GCRuntimeManager {
connected_runtimes: HashMap<String, GCRuntimeHandler>,
runner_mode: GCRunnerMode,
runner_manager: Option<GCRuntimeRunnerManager>,
}Expand description
The runtime manager is responsible for managing the runtimes.
Fields§
§connected_runtimes: HashMap<String, GCRuntimeHandler>§runner_mode: GCRunnerMode§runner_manager: Option<GCRuntimeRunnerManager>Implementations§
§impl GCRuntimeManager
impl GCRuntimeManager
pub fn new( runner_mode: GCRunnerMode, runner: Option<Arc<dyn RuntimeRunner>>, _config: &GCConfigDatabase, ) -> GCRuntimeManager
pub async fn new_runtime( &mut self, id: String, host: IpAddr, rest_port: u16, tcp_port: u16, config: &GCConfigDatabase, ) -> Result<(), RuntimeManagerError>
pub async fn sync(
&mut self,
config: &GCConfigDatabase,
) -> Result<(), RuntimeManagerError>
pub async fn sync( &mut self, config: &GCConfigDatabase, ) -> Result<(), RuntimeManagerError>
Syncs all the runtimes in parallel with the configuration database. If a runtime is not present in the configuration database, it will be removed.
If there are runtimes in the database that do not exist in the runtime manager, they will NOT be added. New runtimes need to be added using the new_runtime method.
pub fn get_runtime_handler(&self, id: &str) -> Option<&GCRuntimeHandler>
pub fn get_rest_client(&self, id: &str) -> Option<&GCRuntimeRestClient>
pub fn get_runtimes(&self) -> impl Iterator<Item = &String>
pub fn remove_runtime(&mut self, id: &str) -> Option<GCRuntimeHandler>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GCRuntimeManager
impl !RefUnwindSafe for GCRuntimeManager
impl Send for GCRuntimeManager
impl Sync for GCRuntimeManager
impl Unpin for GCRuntimeManager
impl UnsafeUnpin for GCRuntimeManager
impl !UnwindSafe for GCRuntimeManager
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