Struct GCRuntimeManager
pub struct GCRuntimeManager {
runtimes: HashMap<String, GCRuntimeHandler>,
}Expand description
The runtime manager is responsible for managing the runtimes. Runtimes are only added if they are present in the configuration database.
The runtime manager should never write to the configuration database. It should sync instead.
Fields§
§runtimes: HashMap<String, GCRuntimeHandler>Implementations§
§impl GCRuntimeManager
impl 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 clear(&mut self, config: &mut GCConfigDatabase)
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 there 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>
Trait Implementations§
§impl Debug for GCRuntimeManager
impl Debug for GCRuntimeManager
§impl Default for GCRuntimeManager
impl Default for GCRuntimeManager
§fn default() -> GCRuntimeManager
fn default() -> GCRuntimeManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GCRuntimeManager
impl !RefUnwindSafe for GCRuntimeManager
impl Send for GCRuntimeManager
impl Sync for GCRuntimeManager
impl Unpin 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