pub struct WorkspacePathsDefaults<P>where
P: WorkspacePaths + ?Sized,{ /* private fields */ }Expand description
Adapter that maps an existing WorkspacePaths implementation into a
ConfigDefaultsProvider.
Implementations§
Source§impl<P> WorkspacePathsDefaults<P>where
P: WorkspacePaths + 'static,
impl<P> WorkspacePathsDefaults<P>where
P: WorkspacePaths + 'static,
Sourcepub fn new(paths: Arc<P>) -> WorkspacePathsDefaults<P>
pub fn new(paths: Arc<P>) -> WorkspacePathsDefaults<P>
Creates a defaults provider that delegates to the supplied
WorkspacePaths implementation.
Sourcepub fn with_config_file_name(
self,
file_name: impl Into<String>,
) -> WorkspacePathsDefaults<P>
pub fn with_config_file_name( self, file_name: impl Into<String>, ) -> WorkspacePathsDefaults<P>
Overrides the configuration file name returned by the provider.
Sourcepub fn with_home_paths(
self,
home_paths: Vec<PathBuf>,
) -> WorkspacePathsDefaults<P>
pub fn with_home_paths( self, home_paths: Vec<PathBuf>, ) -> WorkspacePathsDefaults<P>
Overrides the fallback configuration search paths returned by the provider.
Sourcepub fn with_system_config_paths(
self,
system_paths: Vec<PathBuf>,
) -> WorkspacePathsDefaults<P>
pub fn with_system_config_paths( self, system_paths: Vec<PathBuf>, ) -> WorkspacePathsDefaults<P>
Overrides the system configuration search paths returned by the provider.
Sourcepub fn with_syntax_theme(
self,
theme: impl Into<String>,
) -> WorkspacePathsDefaults<P>
pub fn with_syntax_theme( self, theme: impl Into<String>, ) -> WorkspacePathsDefaults<P>
Overrides the default syntax theme returned by the provider.
Sourcepub fn with_syntax_languages(
self,
languages: Vec<String>,
) -> WorkspacePathsDefaults<P>
pub fn with_syntax_languages( self, languages: Vec<String>, ) -> WorkspacePathsDefaults<P>
Overrides the default syntax languages returned by the provider.
Sourcepub fn build(self) -> Box<dyn ConfigDefaultsProvider>
pub fn build(self) -> Box<dyn ConfigDefaultsProvider>
Consumes the builder, returning a boxed provider implementation.
Trait Implementations§
Source§impl<P> Clone for WorkspacePathsDefaults<P>
impl<P> Clone for WorkspacePathsDefaults<P>
Source§fn clone(&self) -> WorkspacePathsDefaults<P>
fn clone(&self) -> WorkspacePathsDefaults<P>
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 moreSource§impl<P> ConfigDefaultsProvider for WorkspacePathsDefaults<P>where
P: WorkspacePaths + 'static,
impl<P> ConfigDefaultsProvider for WorkspacePathsDefaults<P>where
P: WorkspacePaths + 'static,
Source§fn config_file_name(&self) -> &str
fn config_file_name(&self) -> &str
Returns the primary configuration file name expected in a workspace.
Source§fn workspace_paths_for(&self, _workspace_root: &Path) -> Box<dyn WorkspacePaths>
fn workspace_paths_for(&self, _workspace_root: &Path) -> Box<dyn WorkspacePaths>
Creates a
WorkspacePaths implementation for the provided workspace
root.Source§fn home_config_paths(&self, config_file_name: &str) -> Vec<PathBuf>
fn home_config_paths(&self, config_file_name: &str) -> Vec<PathBuf>
Returns the fallback configuration locations searched outside the
workspace.
Source§fn system_config_paths(
&self,
config_file_name: &str,
) -> Result<Vec<PathBuf>, Error>
fn system_config_paths( &self, config_file_name: &str, ) -> Result<Vec<PathBuf>, Error>
Returns system configuration files from lowest to highest precedence.
Source§fn syntax_theme(&self) -> String
fn syntax_theme(&self) -> String
Returns the default syntax highlighting theme identifier.
Source§fn syntax_languages(&self) -> Vec<String>
fn syntax_languages(&self) -> Vec<String>
Returns the default list of syntax highlighting languages.
Auto Trait Implementations§
impl<P> Forget for WorkspacePathsDefaults<P>where
P: ?Sized,
impl<P> Freeze for WorkspacePathsDefaults<P>
impl<P> Move for WorkspacePathsDefaults<P>where
P: ?Sized,
impl<P> RefUnwindSafe for WorkspacePathsDefaults<P>
impl<P> Send for WorkspacePathsDefaults<P>
impl<P> Sync for WorkspacePathsDefaults<P>
impl<P> Unpin for WorkspacePathsDefaults<P>
impl<P> UnsafeUnpin for WorkspacePathsDefaults<P>
impl<P> UnwindSafe for WorkspacePathsDefaults<P>
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
impl<T> CacheValue for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more