pub struct SmbServer { /* private fields */ }Expand description
A built but not-yet-running SMB server.
Use serve() to bind the configured listener and run until shutdown.
Implementations§
Source§impl SmbServer
impl SmbServer
pub fn builder() -> SmbServerBuilder
pub fn config_handle(&self) -> ConfigHandle
Sourcepub async fn bind(&self) -> Result<SocketAddr>
pub async fn bind(&self) -> Result<SocketAddr>
Bind the configured listen address without yet entering the accept loop. Required for tests that need the actual port (e.g. when the builder used port 0).
Sourcepub async fn local_addr(&self) -> Option<SocketAddr>
pub async fn local_addr(&self) -> Option<SocketAddr>
Returns the actual bound address. None if bind()/serve() have
not yet been called.
Sourcepub fn configured_addr(&self) -> SocketAddr
pub fn configured_addr(&self) -> SocketAddr
Configured listen address (the intended address; may be 0.0.0.0:0
before binding).
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Initiate a graceful shutdown. Stops the accept loop and lets in-flight connection tasks complete.
Sourcepub fn shutdown_handle(&self) -> ShutdownHandle
pub fn shutdown_handle(&self) -> ShutdownHandle
Returns a clonable handle that can request shutdown after serve()
has consumed the SmbServer value.
Auto Trait Implementations§
impl !Freeze for SmbServer
impl !RefUnwindSafe for SmbServer
impl !UnwindSafe for SmbServer
impl Send for SmbServer
impl Sync for SmbServer
impl Unpin for SmbServer
impl UnsafeUnpin for SmbServer
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