use super::MountOptions;
use crate::device::BlockDevice;
use crate::error::{Error, Result};
use crate::fs::Fs;
use std::path::Path;
pub struct Mounted(());
impl Mounted {
#[must_use]
pub const fn is_mounted(&self) -> bool {
false
}
#[allow(clippy::unnecessary_wraps)]
pub const fn unmount(self) -> Result<()> {
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
pub const fn wait(self) -> Result<()> {
Ok(())
}
}
pub fn spawn<D: BlockDevice + Send + 'static>(
fs: Fs<D>,
mountpoint: &Path,
options: &MountOptions,
) -> Result<Mounted> {
let _ = (fs, mountpoint, options);
Err(Error::Unsupported(
"this build has no mount driver; rebuild with `--features fuse` (Linux, \
FreeBSD, macOS with macFUSE) or `--features dokan` (Windows x64 with \
Dokan 2)"
.into(),
))
}
pub fn mount<D: BlockDevice + Send + 'static>(
fs: Fs<D>,
mountpoint: &Path,
options: &MountOptions,
) -> Result<()> {
spawn(fs, mountpoint, options)?.wait()
}