Skip to main content

JjCommandSpec

Struct JjCommandSpec 

Source
pub struct JjCommandSpec { /* private fields */ }
Expand description

A typed description of one jj command.

Implementations§

Source§

impl JjCommandSpec

Source

pub fn render_read_only( argv: impl IntoIterator<Item = impl Into<OsString>>, ) -> Self

Creates a read-only jj command spec from command arguments after the jj binary.

Source

pub fn confirm_mutation( argv: impl IntoIterator<Item = impl Into<OsString>>, safety: SafetyClass, ) -> Self

Creates a jj command spec that must be previewed before mutation execution.

Source

pub fn with_cwd(self, cwd: impl Into<PathBuf>) -> Self

Sets the process working directory metadata.

Source

pub fn with_repository(self, repository: impl Into<PathBuf>) -> Self

Sets the repository path metadata.

Source

pub fn with_global_options(self, global_options: GlobalOptions) -> Self

Sets the global jj options.

Source

pub fn with_stdin(self, stdin: impl Into<String>) -> Self

Sets stdin text for a future command runner.

Source

pub fn with_title(self, title: impl Into<String>) -> Self

Sets the display title independently from the executable argv.

Source

pub const fn with_mode(self, mode: ExecutionMode) -> Self

Sets the execution mode.

Source

pub const fn with_safety(self, safety: SafetyClass) -> Self

Sets the safety class.

Source

pub const fn with_refresh_plan(self, refresh_plan: RefreshPlan) -> Self

Sets the refresh plan.

Source

pub fn argv(&self) -> &[OsString]

Returns command arguments after the jj binary.

Source

pub const fn global_options(&self) -> &GlobalOptions

Returns global jj options owned by the spec.

Source

pub fn global_argv(&self) -> Vec<OsString>

Returns global jj arguments rendered before the command family.

Source

pub fn process_argv(&self) -> Vec<OsString>

Returns process arguments after the jj binary.

Source

pub fn cwd(&self) -> Option<&Path>

Returns the process working directory metadata.

Source

pub fn repository(&self) -> Option<&Path>

Returns the repository path metadata.

Source

pub fn stdin(&self) -> Option<&str>

Returns stdin text for a future command runner.

Source

pub fn title(&self) -> &str

Returns the display title.

Source

pub fn preview(&self) -> String

Returns a display-only command preview.

Source

pub fn process_preview(&self) -> String

Returns a display-only process preview with global options before command arguments.

Source

pub fn command_preview(&self) -> CommandPreview

Returns a command preview suitable for confirmation UI.

Source

pub const fn mode(&self) -> ExecutionMode

Returns the execution mode.

Source

pub const fn safety(&self) -> SafetyClass

Returns the safety class.

Source

pub const fn refresh_plan(&self) -> RefreshPlan

Returns the refresh plan.

Trait Implementations§

Source§

impl Clone for JjCommandSpec

Source§

fn clone(&self) -> JjCommandSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for JjCommandSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for JjCommandSpec

Source§

impl PartialEq for JjCommandSpec

Source§

fn eq(&self, other: &JjCommandSpec) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for JjCommandSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.