pub struct ProxyManagerBuilder { /* private fields */ }Expand description
Fluent builder for ProxyManager.
Implementations§
Source§impl ProxyManagerBuilder
impl ProxyManagerBuilder
pub fn storage(self, s: Arc<dyn ProxyStoragePort>) -> Self
pub fn strategy(self, s: BoxedRotationStrategy) -> Self
pub fn config(self, c: ProxyConfig) -> Self
Sourcepub fn observer(self, o: BoxedBayesianObserver) -> Self
pub fn observer(self, o: BoxedBayesianObserver) -> Self
Set a custom crate::BayesianObserver. Mostly useful for tests and for
callers who want to plug in their own bandit algorithm without
using with_thompson_sampling.
Sourcepub fn build(self) -> ProxyResult<ProxyManager>
pub fn build(self) -> ProxyResult<ProxyManager>
Build the ProxyManager.
Defaults: strategy = RoundRobinStrategy, config = ProxyConfig::default(),
observer = NoopBayesianObserver.
Returns an error if no storage was set.
§Errors
Returns ProxyError::ConfigError when no storage was supplied to
the builder.
Trait Implementations§
Source§impl Default for ProxyManagerBuilder
impl Default for ProxyManagerBuilder
Source§fn default() -> ProxyManagerBuilder
fn default() -> ProxyManagerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ProxyManagerBuilder
impl !UnwindSafe for ProxyManagerBuilder
impl Freeze for ProxyManagerBuilder
impl Send for ProxyManagerBuilder
impl Sync for ProxyManagerBuilder
impl Unpin for ProxyManagerBuilder
impl UnsafeUnpin for ProxyManagerBuilder
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