pub struct AgentBuilder { /* private fields */ }Expand description
Builder for SecureAgent — convenient when wiring multiple engines together.
Implementations§
Source§impl AgentBuilder
impl AgentBuilder
Sourcepub fn with_engine(self, engine: Arc<dyn PolicyEngine>) -> Self
pub fn with_engine(self, engine: Arc<dyn PolicyEngine>) -> Self
Set the policy engine.
Sourcepub fn with_composed_engine(
self,
primary: Arc<dyn PolicyEngine>,
fallback: Arc<dyn PolicyEngine>,
) -> Self
pub fn with_composed_engine( self, primary: Arc<dyn PolicyEngine>, fallback: Arc<dyn PolicyEngine>, ) -> Self
Compose two engines: primary first, falling back to fallback on delegation.
Uses [CombineStrategy::PriorityOrder]: the primary engine’s answer wins
unless it delegates, in which case the fallback is tried.
For more control (e.g., DenyOverrides, AllowIfAny), build a
typesec_core::ComposedEngine directly with typesec_core::PolicyEngineBuilder
and pass it to AgentBuilder::with_engine.
Sourcepub fn build(self) -> Result<SecureAgent<Unauthenticated>, String>
pub fn build(self) -> Result<SecureAgent<Unauthenticated>, String>
Build the agent.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AgentBuilder
impl !UnwindSafe for AgentBuilder
impl Freeze for AgentBuilder
impl Send for AgentBuilder
impl Sync for AgentBuilder
impl Unpin for AgentBuilder
impl UnsafeUnpin for AgentBuilder
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