Skip to main content

area_limits

Function area_limits 

Source
pub fn area_limits(
    definition: &AgentDefinition,
    area: &Partition,
) -> Vec<String>
Expand description

Why definition exceeds its area (spec 3.3 §5.7): a mode looser than the area’s, a daily limit above the area’s, or a driver not mounted for it. Empty when it fits.

§Example

use adk_kernel::agents::{AgentDefinition, AgentUses, area_limits};
use adk_kernel::{Partition, PartitionMode};

let home = Partition::new("home", "home").with_mode(PartitionMode::Ask);
let ok = AgentDefinition::new("Finance", "home").with_mode(PartitionMode::Plan);
assert!(area_limits(&ok, &home).is_empty());
let loose = ok.clone().with_mode(PartitionMode::Auto).with_uses(AgentUses::default().with_driver("mail"));
assert_eq!(area_limits(&loose, &home).len(), 2);