pub struct PolicyEngine {
pub max_retries: u32,
pub min_delay_ms: u32,
pub max_delay_ms: u32,
/* private fields */
}Expand description
Internal policy engine that unifies retry / fallback behavior.
Important constraints:
- Keep this internal (no public API commitments yet).
- Prefer deterministic, explainable behavior over clever heuristics.
Fields§
§max_retries: u32§min_delay_ms: u32§max_delay_ms: u32Implementations§
Source§impl PolicyEngine
impl PolicyEngine
pub fn new(manifest: &ProtocolManifest) -> PolicyEngine
Sourcepub fn validate_capabilities(
&self,
request: &UnifiedRequest,
) -> Result<(), Error>
pub fn validate_capabilities( &self, request: &UnifiedRequest, ) -> Result<(), Error>
Validates if the manifest supports all capabilities required by the request.
This is a pre-flight guard that validates user intent against protocol capabilities before making any network requests, saving latency and cost.
Sourcepub fn pre_decide(
&self,
signals: &SignalsSnapshot,
has_fallback: bool,
) -> Option<Decision>
pub fn pre_decide( &self, signals: &SignalsSnapshot, has_fallback: bool, ) -> Option<Decision>
Optional pre-decision based on current runtime signals (facts), before attempting a call.
Keep this conservative: only skip work that is known to fail right now.
Auto Trait Implementations§
impl Freeze for PolicyEngine
impl RefUnwindSafe for PolicyEngine
impl Send for PolicyEngine
impl Sync for PolicyEngine
impl Unpin for PolicyEngine
impl UnsafeUnpin for PolicyEngine
impl UnwindSafe for PolicyEngine
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