pub struct CallCenterClientBuilder { /* private fields */ }
Expand description
Builder for creating a CallCenterClient
The CallCenterClientBuilder
provides a fluent interface for configuring and
constructing CallCenterClient
instances. This builder pattern allows for
clean configuration of various client options before creating the final client.
§Configuration Options
- Configuration: Core call center configuration including routing rules
- Database Path: Optional database path for persistent storage
- Custom Settings: Additional customization options
§Examples
§Basic Client Creation
use rvoip_call_engine::api::CallCenterClient;
use rvoip_call_engine::config::CallCenterConfig;
let client = CallCenterClient::builder()
.with_config(CallCenterConfig::default())
.build()
.await?;
println!("✅ Client created with default configuration");
§Advanced Configuration
use rvoip_call_engine::api::CallCenterClient;
use rvoip_call_engine::config::{CallCenterConfig, QueueConfig, RoutingConfig};
let mut config = CallCenterConfig::default();
config.routing.enable_load_balancing = true; // Enable load balancing
let client = CallCenterClient::builder()
.with_config(config)
.with_database_path("production_call_center.db".to_string())
.build()
.await?;
println!("🚀 Production client ready with custom configuration");
Implementations§
Source§impl CallCenterClientBuilder
impl CallCenterClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new builder
Initializes a new builder instance with no configuration set. Configuration must be provided before building the client.
§Examples
use rvoip_call_engine::api::client::CallCenterClientBuilder;
let builder = CallCenterClientBuilder::new();
// Further configuration needed before building
Sourcepub fn with_config(self, config: CallCenterConfig) -> Self
pub fn with_config(self, config: CallCenterConfig) -> Self
Set the configuration
Provides the core call center configuration that defines system behavior, routing rules, queue settings, and other operational parameters.
§Arguments
config
- Complete call center configuration
§Examples
use rvoip_call_engine::api::CallCenterClient;
use rvoip_call_engine::config::CallCenterConfig;
let mut config = CallCenterConfig::default();
// Customize configuration
config.routing.enable_time_based_routing = true; // Enable time-based routing
let client = CallCenterClient::builder()
.with_config(config)
.build()
.await?;
Sourcepub fn with_database_path(self, path: String) -> Self
pub fn with_database_path(self, path: String) -> Self
Set the database path
Configures the path for persistent database storage. If not provided, the system will operate with in-memory storage only.
§Arguments
path
- File system path for the database file
§Examples
use rvoip_call_engine::api::CallCenterClient;
use rvoip_call_engine::config::CallCenterConfig;
let client = CallCenterClient::builder()
.with_config(CallCenterConfig::default())
.with_database_path("call_center_data.db".to_string())
.build()
.await?;
println!("💾 Client with persistent database storage");
Sourcepub async fn build(self) -> CallCenterResult<CallCenterClient>
pub async fn build(self) -> CallCenterResult<CallCenterClient>
Build the client
Constructs the final CallCenterClient
instance using the provided
configuration. This method initializes the underlying call center
engine and all necessary components.
§Returns
Ok(CallCenterClient)
if construction succeeds, or error if
configuration is invalid or initialization fails.
§Errors
- Configuration not provided
- Database initialization failure
- Engine startup failure
- Network or resource initialization errors
§Examples
use rvoip_call_engine::api::CallCenterClient;
use rvoip_call_engine::config::CallCenterConfig;
let client = CallCenterClient::builder()
.with_config(CallCenterConfig::default())
.build()
.await?;
println!("🎯 Call center client successfully created");
// Client is now ready for agent registration and operations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CallCenterClientBuilder
impl RefUnwindSafe for CallCenterClientBuilder
impl Send for CallCenterClientBuilder
impl Sync for CallCenterClientBuilder
impl Unpin for CallCenterClientBuilder
impl UnwindSafe for CallCenterClientBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more