pub struct FileToolConfig {
pub allowed_dirs: Option<Vec<PathBuf>>,
pub max_file_size: u64,
}Expand description
文件工具的共享配置
Fields§
§allowed_dirs: Option<Vec<PathBuf>>允许的工作目录(可选,限制文件访问范围)
max_file_size: u64最大文件大小(字节)
Implementations§
Source§impl FileToolConfig
impl FileToolConfig
Sourcepub fn with_allowed_dirs(self, dirs: Vec<PathBuf>) -> Self
pub fn with_allowed_dirs(self, dirs: Vec<PathBuf>) -> Self
设置允许的工作目录
Sourcepub fn with_max_file_size(self, size: u64) -> Self
pub fn with_max_file_size(self, size: u64) -> Self
设置最大文件大小
Trait Implementations§
Source§impl Clone for FileToolConfig
impl Clone for FileToolConfig
Source§fn clone(&self) -> FileToolConfig
fn clone(&self) -> FileToolConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FileToolConfig
impl RefUnwindSafe for FileToolConfig
impl Send for FileToolConfig
impl Sync for FileToolConfig
impl Unpin for FileToolConfig
impl UnsafeUnpin for FileToolConfig
impl UnwindSafe for FileToolConfig
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