pub struct ApiBuilder<E: FactsEmitter, A: AuditSink> { /* private fields */ }
Expand description
Public API builder.
Builder for constructing a Switchyard with ergonomic chaining.
Mirrors Switchyard::new(...).with_*
but avoids duplication at call sites.
Implementations§
Source§impl<E: FactsEmitter, A: AuditSink> ApiBuilder<E, A>
impl<E: FactsEmitter, A: AuditSink> ApiBuilder<E, A>
pub fn new(facts: E, audit: A, policy: Policy) -> Self
Sourcepub fn build(self) -> Switchyard<E, A>
pub fn build(self) -> Switchyard<E, A>
Build a Switchyard
with the configured options.
Example
use switchyard::api::ApiBuilder;
use switchyard::policy::Policy;
use switchyard::logging::JsonlSink;
let facts = JsonlSink::default();
let audit = JsonlSink::default();
let api = ApiBuilder::new(facts, audit, Policy::default())
.with_lock_timeout_ms(500)
.build();
pub fn with_lock_manager(self, lock: Box<dyn DebugLockManager>) -> Self
pub fn with_ownership_oracle(self, owner: Box<dyn DebugOwnershipOracle>) -> Self
pub fn with_attestor(self, attest: Box<dyn DebugAttestor>) -> Self
pub fn with_smoke_runner(self, smoke: Box<dyn DebugSmokeTestRunner>) -> Self
pub const fn with_lock_timeout_ms(self, timeout_ms: u64) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<E, A> Freeze for ApiBuilder<E, A>
impl<E, A> !RefUnwindSafe for ApiBuilder<E, A>
impl<E, A> Send for ApiBuilder<E, A>
impl<E, A> Sync for ApiBuilder<E, A>
impl<E, A> Unpin for ApiBuilder<E, A>
impl<E, A> !UnwindSafe for ApiBuilder<E, A>
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