pub struct RootBuilder { /* private fields */ }Expand description
Builder for creating root configurations at runtime
Implementations§
Source§impl RootBuilder
impl RootBuilder
Sourcepub fn from_path(path: impl Into<PathBuf>) -> Self
pub fn from_path(path: impl Into<PathBuf>) -> Self
Create a root builder from a file path (automatically converts to file:// URI)
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the description for this root
Sourcepub fn meta_value(self, key: impl Into<String>, value: Value) -> Self
pub fn meta_value(self, key: impl Into<String>, value: Value) -> Self
Add a meta key-value pair
Sourcepub fn read_only(self, read_only: bool) -> Self
pub fn read_only(self, read_only: bool) -> Self
Set whether this root is read-only (default: true for safety)
Sourcepub fn read_write(self) -> Self
pub fn read_write(self) -> Self
Allow read and write access (convenience method)
Sourcepub fn allowed_extensions(self, extensions: Vec<String>) -> Self
pub fn allowed_extensions(self, extensions: Vec<String>) -> Self
Set allowed file extensions (None means all extensions allowed)
Sourcepub fn allow_extension(self, extension: impl Into<String>) -> Self
pub fn allow_extension(self, extension: impl Into<String>) -> Self
Add an allowed file extension
Sourcepub fn excluded_patterns(self, patterns: Vec<String>) -> Self
pub fn excluded_patterns(self, patterns: Vec<String>) -> Self
Set excluded file patterns (glob-style patterns)
Sourcepub fn exclude_pattern(self, pattern: impl Into<String>) -> Self
pub fn exclude_pattern(self, pattern: impl Into<String>) -> Self
Add an excluded file pattern
Set tags for this root
Sourcepub fn build(self) -> Result<DynamicRoot, String>
pub fn build(self) -> Result<DynamicRoot, String>
Build the dynamic root configuration
Source§impl RootBuilder
Convenience methods for common root patterns
impl RootBuilder
Convenience methods for common root patterns
Sourcepub fn source_code_root(path: impl Into<PathBuf>) -> Self
pub fn source_code_root(path: impl Into<PathBuf>) -> Self
Create a source code root with common file extensions
Sourcepub fn config_root(path: impl Into<PathBuf>) -> Self
pub fn config_root(path: impl Into<PathBuf>) -> Self
Create a configuration root
Sourcepub fn workspace_root(path: impl Into<PathBuf>) -> Self
pub fn workspace_root(path: impl Into<PathBuf>) -> Self
Create a temporary workspace root with write access
Auto Trait Implementations§
impl Freeze for RootBuilder
impl RefUnwindSafe for RootBuilder
impl Send for RootBuilder
impl Sync for RootBuilder
impl Unpin for RootBuilder
impl UnwindSafe for RootBuilder
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