pub struct WorkspaceCommandEnvironment { /* private fields */ }Expand description
Metadata and configuration loaded for a specific workspace.
Implementations§
source§impl WorkspaceCommandEnvironment
impl WorkspaceCommandEnvironment
pub fn settings(&self) -> &UserSettings
pub fn workspace_id(&self) -> &WorkspaceId
sourcepub fn new_id_prefix_context(&self) -> IdPrefixContext
pub fn new_id_prefix_context(&self) -> IdPrefixContext
Creates fresh new context which manages cache of short commit/change ID prefixes. New context should be created per repo view (or operation.)
sourcepub fn immutable_expression(&self) -> Rc<RevsetExpression>
pub fn immutable_expression(&self) -> Rc<RevsetExpression>
User-configured expression defining the immutable set.
sourcepub fn immutable_heads_expression(&self) -> &Rc<RevsetExpression>
pub fn immutable_heads_expression(&self) -> &Rc<RevsetExpression>
User-configured expression defining the heads of the immutable set.
sourcepub fn parse_template<'a, C: Clone + 'a, L: TemplateLanguage<'a> + ?Sized>(
&self,
ui: &Ui,
language: &L,
template_text: &str,
wrap_self: impl Fn(PropertyPlaceholder<C>) -> L::Property,
) -> Result<TemplateRenderer<'a, C>, CommandError>
pub fn parse_template<'a, C: Clone + 'a, L: TemplateLanguage<'a> + ?Sized>( &self, ui: &Ui, language: &L, template_text: &str, wrap_self: impl Fn(PropertyPlaceholder<C>) -> L::Property, ) -> Result<TemplateRenderer<'a, C>, CommandError>
Parses template of the given language into evaluation tree.
wrap_self specifies the type of the top-level property, which should
be one of the L::wrap_*() functions.
sourcepub fn commit_template_language<'a>(
&'a self,
repo: &'a dyn Repo,
id_prefix_context: &'a IdPrefixContext,
) -> CommitTemplateLanguage<'a>
pub fn commit_template_language<'a>( &'a self, repo: &'a dyn Repo, id_prefix_context: &'a IdPrefixContext, ) -> CommitTemplateLanguage<'a>
Creates commit template language environment for this workspace and the
given repo.
pub fn operation_template_extensions( &self, ) -> &[Arc<dyn OperationTemplateLanguageExtension>]
Auto Trait Implementations§
impl Freeze for WorkspaceCommandEnvironment
impl !RefUnwindSafe for WorkspaceCommandEnvironment
impl !Send for WorkspaceCommandEnvironment
impl !Sync for WorkspaceCommandEnvironment
impl Unpin for WorkspaceCommandEnvironment
impl !UnwindSafe for WorkspaceCommandEnvironment
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
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