pub struct DefaultResourceManager { /* private fields */ }Expand description
Default implementation of the resource manager
Implementations§
Source§impl DefaultResourceManager
impl DefaultResourceManager
Sourcepub async fn new(config: ResourceManagerConfig) -> Result<Self, ResourceError>
pub async fn new(config: ResourceManagerConfig) -> Result<Self, ResourceError>
Create a new resource manager
Trait Implementations§
Source§impl ResourceManager for DefaultResourceManager
impl ResourceManager for DefaultResourceManager
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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
Auto Trait Implementations§
impl Freeze for DefaultResourceManager
impl !RefUnwindSafe for DefaultResourceManager
impl Send for DefaultResourceManager
impl Sync for DefaultResourceManager
impl Unpin for DefaultResourceManager
impl !UnwindSafe for DefaultResourceManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more