Expand description
A safe SMB 1/2/3 client built on Samba’s libsmbclient.
SMB1 (NT1) is never negotiated unless both protocol bounds explicitly request it.
Pavão provides typed APIs for connecting to SMB shares, browsing directories, inspecting metadata, and reading or writing remote files.
§Thread safety
libsmbclient shares process-wide configuration state, so Pavão serializes every native call
across all clients. Multiple clients with separate credentials and other per-context options
may coexist, but they cannot perform SMB work in parallel. All simultaneously live clients
must use the exact same minimum and maximum protocol bounds, including default or partial
bounds. A different policy can be selected after every prior client is dropped.
Raw calls through SmbClient::ctx or pavao-sys bypass this synchronization and must not
race Pavão operations or other raw native calls.
§Performance
The process-wide lock is held for each complete high-level operation. A blocking SMB request therefore delays every other Pavão SMB operation in the process.
§Installation
pavao = "0.3"§Examples
use pavao::{SmbClient, SmbCredentials, SmbOptions};
let _client = SmbClient::new(
SmbCredentials::default()
.server("smb://server.example")
.share("/documents")
.username("alice")
.password("secret")
.workgroup("WORKGROUP"),
SmbOptions::default(),
)?;See the repository’s examples directory for directory-tree and file-transfer programs.
§Feature flags
| name | description | default |
|---|---|---|
debug | Forward verbose native Samba diagnostics to standard error. | |
no-log | Disable log records from this crate at compile time. | |
vendored | Build the bundled Samba source instead of using the system library. |
Structs§
- SmbClient
- A client for accessing files and directories on an SMB share.
- SmbCredentials
- Authentication and share-selection settings for
SmbClient. - SmbDirent
- A directory entry returned by
SmbClient::list_dir. - SmbDirent
Info - A directory entry with metadata returned by an extended listing.
- SmbFile
- An open remote file owned by an
SmbClient. - SmbMode
- A remote entry’s POSIX file type and permission bits.
- SmbMode
Class - POSIX read, write, and execute permissions for one user class.
- SmbOpen
Options - Options controlling how a remote file is opened.
- SmbOptions
- Optional behavior applied when initializing a client’s SMB context.
- SmbStat
- POSIX-style metadata for a remote file or directory.
- SmbStat
Vfs - Filesystem statistics returned by
SmbClient::statvfs.
Enums§
- SmbDialect
- An SMB protocol dialect offered during negotiation.
- SmbDirent
Type - The resource category reported for an SMB directory entry.
- SmbEncryption
Level - Encryption policy for SMB transport traffic.
- SmbError
- An error produced while configuring or using an SMB client.
- SmbShare
Mode - Sharing restrictions applied when opening a remote file.
Type Aliases§
- SmbResult
- A result returned by Pavão operations.