pub struct LocalFsBackend { /* private fields */ }Expand description
Local-filesystem backend, sandboxed at a single root directory.
Handles set access and write times on every host. The creation time is set on Windows and macOS; other hosts have no call that sets it, so a requested creation time is ignored there and the other times still apply. The host keeps the change time.
Implementations§
Source§impl LocalFsBackend
impl LocalFsBackend
Sourcepub fn new(path: impl AsRef<Path>) -> Result<Self>
pub fn new(path: impl AsRef<Path>) -> Result<Self>
Open path as the share root. Errors if the path does not exist or is
not a directory.
Sourcepub fn read_only(self) -> Self
pub fn read_only(self) -> Self
Mark the backend as read-only. All write-class opens and writes return an access-denied SMB error.
Sourcepub fn watch_host_changes(self, enabled: bool) -> Self
pub fn watch_host_changes(self, enabled: bool) -> Self
Report changes made to the share’s directories outside the server,
by other programs on the host or through other shares, to clients
that watch them. On Linux only, through inotify: only the entries
directly in a watched directory are seen. The parent of each watched
directory, the share root’s parent included, is watched too, to see
the directory deleted. The backend holds at most 4096 kernel
watches; a directory past that, or one the kernel will not watch,
past fs.inotify.max_user_watches or fs.inotify.max_user_instances
or without /proc, gets only the changes made through the server,
with a warning logged once. On by default.
Trait Implementations§
Source§fn open<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 SmbPath,
opts: OpenOptions,
) -> Pin<Box<dyn Future<Output = SmbResult<(Box<dyn Handle>, OpenAction)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn open<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 SmbPath,
opts: OpenOptions,
) -> Pin<Box<dyn Future<Output = SmbResult<(Box<dyn Handle>, OpenAction)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn unlink<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 SmbPath,
) -> Pin<Box<dyn Future<Output = SmbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unlink<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 SmbPath,
) -> Pin<Box<dyn Future<Output = SmbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 SmbPath,
to: &'life2 SmbPath,
replace_if_exists: bool,
) -> Pin<Box<dyn Future<Output = SmbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 SmbPath,
to: &'life2 SmbPath,
replace_if_exists: bool,
) -> Pin<Box<dyn Future<Output = SmbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn capabilities(&self) -> BackendCapabilities
fn capabilities(&self) -> BackendCapabilities
is_read_only is set.Source§fn volume_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SmbResult<VolumeInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn volume_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SmbResult<VolumeInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
VolumeInfo::default.