Struct jj_cli::commit_templater::CommitTemplateLanguage
source · pub struct CommitTemplateLanguage<'repo> { /* private fields */ }Implementations§
source§impl<'repo> CommitTemplateLanguage<'repo>
impl<'repo> CommitTemplateLanguage<'repo>
sourcepub fn new(
repo: &'repo dyn Repo,
workspace_id: &WorkspaceId,
revset_parse_context: RevsetParseContext<'repo>,
id_prefix_context: &'repo IdPrefixContext,
extensions: &[impl AsRef<dyn CommitTemplateLanguageExtension>],
) -> Self
pub fn new( repo: &'repo dyn Repo, workspace_id: &WorkspaceId, revset_parse_context: RevsetParseContext<'repo>, id_prefix_context: &'repo IdPrefixContext, extensions: &[impl AsRef<dyn CommitTemplateLanguageExtension>], ) -> Self
Sets up environment where commit template will be transformed to evaluation tree.
source§impl<'repo> CommitTemplateLanguage<'repo>
impl<'repo> CommitTemplateLanguage<'repo>
pub fn repo(&self) -> &'repo dyn Repo
pub fn workspace_id(&self) -> &WorkspaceId
pub fn keyword_cache(&self) -> &CommitKeywordCache<'repo>
pub fn cache_extension<T: Any>(&self) -> Option<&T>
pub fn wrap_commit( property: impl TemplateProperty<Output = Commit> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
pub fn wrap_commit_opt( property: impl TemplateProperty<Output = Option<Commit>> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
pub fn wrap_commit_list( property: impl TemplateProperty<Output = Vec<Commit>> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
pub fn wrap_ref_name( property: impl TemplateProperty<Output = Rc<RefName>> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
pub fn wrap_ref_name_opt( property: impl TemplateProperty<Output = Option<Rc<RefName>>> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
pub fn wrap_ref_name_list( property: impl TemplateProperty<Output = Vec<Rc<RefName>>> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
pub fn wrap_commit_or_change_id( property: impl TemplateProperty<Output = CommitOrChangeId> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
pub fn wrap_shortest_id_prefix( property: impl TemplateProperty<Output = ShortestIdPrefix> + 'repo, ) -> CommitTemplatePropertyKind<'repo>
Trait Implementations§
source§impl<'repo> TemplateLanguage<'repo> for CommitTemplateLanguage<'repo>
impl<'repo> TemplateLanguage<'repo> for CommitTemplateLanguage<'repo>
type Property = CommitTemplatePropertyKind<'repo>
fn wrap_string( property: impl TemplateProperty<Output = String> + 'repo, ) -> Self::Property
fn wrap_string_list( property: impl TemplateProperty<Output = Vec<String>> + 'repo, ) -> Self::Property
fn wrap_boolean( property: impl TemplateProperty<Output = bool> + 'repo, ) -> Self::Property
fn wrap_integer( property: impl TemplateProperty<Output = i64> + 'repo, ) -> Self::Property
fn wrap_integer_opt( property: impl TemplateProperty<Output = Option<i64>> + 'repo, ) -> Self::Property
fn wrap_signature( property: impl TemplateProperty<Output = Signature> + 'repo, ) -> Self::Property
fn wrap_size_hint( property: impl TemplateProperty<Output = SizeHint> + 'repo, ) -> Self::Property
fn wrap_timestamp( property: impl TemplateProperty<Output = Timestamp> + 'repo, ) -> Self::Property
fn wrap_timestamp_range( property: impl TemplateProperty<Output = TimestampRange> + 'repo, ) -> Self::Property
fn wrap_template(template: Box<dyn Template + 'repo>) -> Self::Property
fn wrap_list_template(template: Box<dyn ListTemplate + 'repo>) -> Self::Property
source§fn build_function(
&self,
build_ctx: &BuildContext<'_, Self::Property>,
function: &FunctionCallNode<'_>,
) -> TemplateParseResult<Self::Property>
fn build_function( &self, build_ctx: &BuildContext<'_, Self::Property>, function: &FunctionCallNode<'_>, ) -> TemplateParseResult<Self::Property>
Translates the given global
function call to a property. Read morefn build_method( &self, build_ctx: &BuildContext<'_, Self::Property>, property: Self::Property, function: &FunctionCallNode<'_>, ) -> TemplateParseResult<Self::Property>
Auto Trait Implementations§
impl<'repo> !Freeze for CommitTemplateLanguage<'repo>
impl<'repo> !RefUnwindSafe for CommitTemplateLanguage<'repo>
impl<'repo> !Send for CommitTemplateLanguage<'repo>
impl<'repo> !Sync for CommitTemplateLanguage<'repo>
impl<'repo> Unpin for CommitTemplateLanguage<'repo>
impl<'repo> !UnwindSafe for CommitTemplateLanguage<'repo>
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