pub struct ConfigBuilder { /* private fields */ }Expand description
Configuration builder for core settings
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn max_message_size(self, size: usize) -> Result<Self, String>
pub fn max_message_size(self, size: usize) -> Result<Self, String>
Set maximum message size
§Examples
use turbomcp_protocol::config::ConfigBuilder;
let config = ConfigBuilder::new()
.max_message_size(1024 * 1024).unwrap()
.build();
assert_eq!(config.max_message_size, 1024 * 1024);
// Validation errors
assert!(ConfigBuilder::new().max_message_size(0).is_err());
assert!(ConfigBuilder::new().max_message_size(2 * 1024 * 1024 * 1024).is_err());Sourcepub fn timeout_ms(self, timeout: u64) -> Result<Self, String>
pub fn timeout_ms(self, timeout: u64) -> Result<Self, String>
Set operation timeout
Sourcepub const fn tracing_enabled(self, enabled: bool) -> Self
pub const fn tracing_enabled(self, enabled: bool) -> Self
Enable or disable tracing
Sourcepub fn option<V: Serialize>(self, key: &str, value: V) -> Result<Self, Error>
pub fn option<V: Serialize>(self, key: &str, value: V) -> Result<Self, Error>
Add a configuration option
Sourcepub fn build(self) -> CoreConfig
pub fn build(self) -> CoreConfig
Build the configuration
Trait Implementations§
Source§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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