pub struct SdkConfigBuilder<S> { /* private fields */ }Expand description
Typed builder for SdkConfig with compile-time validation.
§Type-State Pattern
The builder uses a phantom type parameter to track whether the required
base_url field has been set. Calling .build() on an incomplete
builder is a compile-time error.
ⓘ
// This will not compile - base_url not set:
let config = SdkConfigBuilder::<()>::new().build();Implementations§
Source§impl<S> SdkConfigBuilder<S>
impl<S> SdkConfigBuilder<S>
Sourcepub fn auth(self, auth: AuthStrategy) -> Self
pub fn auth(self, auth: AuthStrategy) -> Self
Set the authentication strategy.
Sourcepub fn user_agent(self, agent: impl Into<String>) -> Self
pub fn user_agent(self, agent: impl Into<String>) -> Self
Set the user-agent header.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for SdkConfigBuilder<S>
impl<S> RefUnwindSafe for SdkConfigBuilder<S>where
S: RefUnwindSafe,
impl<S> Send for SdkConfigBuilder<S>where
S: Send,
impl<S> Sync for SdkConfigBuilder<S>where
S: Sync,
impl<S> Unpin for SdkConfigBuilder<S>where
S: Unpin,
impl<S> UnsafeUnpin for SdkConfigBuilder<S>
impl<S> UnwindSafe for SdkConfigBuilder<S>where
S: UnwindSafe,
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