Skip to main content

smb

5 configuration options · available in Rust

Quick start
use opendal::Operator;

let operator = Operator::via_iter("smb", [
("endpoint".to_string(), "server.example.com:445".to_string()),
("share".to_string(), "documents".to_string()),
])?;
All configuration options (copy & trim)
Full reference
use opendal::Operator;

let operator = Operator::via_iter("smb", [
// Required server hostname or IP address, with an optional port. The default port is 445.
("endpoint".to_string(), "server.example.com:445".to_string()),

// Required name of the SMB share.
("share".to_string(), "documents".to_string()),

// Root directory within the share. Defaults to `/`.
// ("root".to_string(), "...".to_string()),

// NTLM username, optionally qualified as `DOMAIN\user` or `user@domain`.
// ("user".to_string(), "...".to_string()),

// Password for the configured user.
// ("password".to_string(), "...".to_string()),
])?;

Every option is passed as a string key; OpenDAL parses it into the right type. Some services may require building the binding with the matching services-* feature enabled.

Configuration reference

General5
KeyTypeRequiredDescription
endpointe.g. server.example.com:445stringyesRequired server hostname or IP address, with an optional port. The default port is 445.
sharee.g. documentsstringyesRequired name of the SMB share.
rootstringnoRoot directory within the share. Defaults to /.
userstringnoNTLM username, optionally qualified as DOMAIN\user or user@domain.
passwordstringnoPassword for the configured user.