Skip to main content

ResourceManager

Trait ResourceManager 

Source
pub trait ResourceManager {
    // Required methods
    fn allocate_resources<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
        requirements: ResourceRequirements,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceAllocation, ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn deallocate_resources<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_usage<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
        usage: ResourceUsage,
    ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_usage<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceUsage, ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_system_status<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ResourceSystemStatus> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_limits<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
        limits: ResourceLimits,
    ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn check_limits<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<bool, ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn check_resource_violations<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceViolation>, ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn check_health<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ComponentHealth, ResourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Resource manager trait

Required Methods§

Source

fn allocate_resources<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, requirements: ResourceRequirements, ) -> Pin<Box<dyn Future<Output = Result<ResourceAllocation, ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Allocate resources for an agent

Source

fn deallocate_resources<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deallocate resources for an agent

Source

fn update_usage<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, usage: ResourceUsage, ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update resource usage for an agent

Source

fn get_usage<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<ResourceUsage, ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get current resource usage for an agent

Source

fn get_system_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ResourceSystemStatus> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get system resource status

Source

fn set_limits<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, limits: ResourceLimits, ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set resource limits for an agent

Source

fn check_limits<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<bool, ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if agent is within resource limits

Source

fn check_resource_violations<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceViolation>, ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check resource access violations for an agent

Source

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown the resource manager

Source

fn check_health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ComponentHealth, ResourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check the health of the resource manager

Implementors§