pub struct WinrmClientBuilder<S = NeedsCredentials> { /* private fields */ }Expand description
Builder for WinrmClient with compile-time state tracking.
Ensures that credentials are always provided before the client is built.
§Example
use winrm_rs::{WinrmClientBuilder, WinrmConfig, WinrmCredentials};
let client = WinrmClientBuilder::new(WinrmConfig::default())
.credentials(WinrmCredentials::new("admin", "pass", ""))
.build()
.unwrap();Implementations§
Source§impl WinrmClientBuilder<NeedsCredentials>
impl WinrmClientBuilder<NeedsCredentials>
Sourcepub fn new(config: WinrmConfig) -> Self
pub fn new(config: WinrmConfig) -> Self
Create a new builder with the given configuration.
Sourcepub fn credentials(self, creds: WinrmCredentials) -> WinrmClientBuilder<Ready>
pub fn credentials(self, creds: WinrmCredentials) -> WinrmClientBuilder<Ready>
Set the authentication credentials, transitioning to the Ready state.
Source§impl WinrmClientBuilder<Ready>
impl WinrmClientBuilder<Ready>
Sourcepub fn build(self) -> Result<WinrmClient, WinrmError>
pub fn build(self) -> Result<WinrmClient, WinrmError>
Build the WinrmClient.
Returns WinrmError::Http if the underlying HTTP client cannot be
constructed.
Auto Trait Implementations§
impl<S> Freeze for WinrmClientBuilder<S>
impl<S> RefUnwindSafe for WinrmClientBuilder<S>where
S: RefUnwindSafe,
impl<S> Send for WinrmClientBuilder<S>where
S: Send,
impl<S> Sync for WinrmClientBuilder<S>where
S: Sync,
impl<S> Unpin for WinrmClientBuilder<S>where
S: Unpin,
impl<S> UnsafeUnpin for WinrmClientBuilder<S>
impl<S> UnwindSafe for WinrmClientBuilder<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