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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), 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,
Shutdown the resource manager
Sourcefn 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,
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