Skip to main content

Configure

Struct Configure 

Source
pub struct Configure<T = Unselected> { /* private fields */ }
Expand description

Type-safe builder for p4 configure.

Set, view, and manage server configuration variables, including comments.

Configuration variables are used to control and customize the behavior of the Perforce service.

The T type parameter tracks the selected operation at compile time: it starts as Unselected, in which the command has no effect and cannot be spawned. Use one of the builder methods to select the operation: set, unset, or show , history , patch, or help.

Implementations§

Source§

impl Configure<Unselected>

Source

pub fn new(bin: impl Into<PathBuf>, global_opts: GlobalOpts) -> Self

Creates a new p4 configure command with no operation selected.

bin is the path to the Perforce command-line executable. The command has no effect in this state; use one of the builder methods to select the operation before spawning.

Source

pub fn get_bin(&self) -> &Path

Get the Perforce command path.

Source

pub fn set_bin(&mut self, bin: impl Into<PathBuf>) -> &mut Self

Set the Perforce command path.

Source

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

Set the Perforce command path.

Source

pub fn set( self, variable: impl Into<String>, value: impl Into<String>, ) -> Configure<SetVariable>

Selects the set operation.

The variable and value are required; the optional server_id prefix and the --comment refinement are set on the returned builder.

Source

pub fn unset(self, variable: impl Into<String>) -> Configure<UnSetVariable>

Selects the unset operation.

The variable is required; the optional server_id prefix and the --comment refinement are set on the returned builder.

Source

pub fn show(self) -> Configure<Show>

Selects the show operation.

The returned builder spawns the bare p4 configure show report; use allservers, server, or variable to restrict the report.

Source

pub fn history(self) -> Configure<History>

Selects the history operation.

The returned builder spawns the bare p4 configure history report; use allservers, server, or variable to restrict the report.

Source

pub fn patch( self, variable: impl Into<String>, comment: impl Into<String>, ) -> Configure<Patch>

Selects the p4 configure history comment patch form.

Sets the comment on the history of variable, optionally targeting a specific history entry with iteration.

Source

pub fn help(self) -> Configure<Help>

Selects the help operation.

Source§

impl<T: SubCommand> Configure<T>

Source

pub fn get_bin(&self) -> &Path

Get the Perforce command path.

Source

pub fn set_bin(&mut self, bin: impl Into<PathBuf>) -> &mut Self

Set the Perforce command path.

Source

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

Set the Perforce command path.

Source§

impl Configure<SetVariable>

Source

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

Returns the server whose configuration is being set, if any.

Source

pub fn set_server_id(&mut self, v: impl Into<String>) -> &mut Self

Sets the [serverid#] prefix.

Source

pub fn server_id(self, v: impl Into<String>) -> Self

Sets the [serverid#] prefix.

Source

pub fn get_variable(&self) -> &str

Returns the name of the variable being set.

Source

pub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self

Sets the name of the variable being set.

Source

pub fn variable(self, v: impl Into<String>) -> Self

Sets the name of the variable being set.

Source

pub fn get_value(&self) -> &str

Returns the value being assigned.

Source

pub fn set_value(&mut self, v: impl Into<String>) -> &mut Self

Sets the value to assign.

Source

pub fn value(self, v: impl Into<String>) -> Self

Sets the value to assign.

Source

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

Returns the comment attached to the change, if any.

Source

pub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self

Sets --comment=comment.

Source

pub fn comment(self, v: impl Into<String>) -> Self

Sets --comment=comment.

Source§

impl Configure<UnSetVariable>

Source

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

Returns the server whose configuration is being unset, if any.

Source

pub fn set_server_id(&mut self, v: impl Into<String>) -> &mut Self

Sets the [serverid#] prefix.

Source

pub fn server_id(self, v: impl Into<String>) -> Self

Sets the [serverid#] prefix.

Source

pub fn get_variable(&self) -> &str

Returns the name of the variable being unset.

Source

pub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self

Sets the name of the variable being unset.

Source

pub fn variable(self, v: impl Into<String>) -> Self

Sets the name of the variable being unset.

Source

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

Returns the comment attached to the change, if any.

Source

pub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self

Sets --comment=comment.

Source

pub fn comment(self, v: impl Into<String>) -> Self

Sets --comment=comment.

Source§

impl Configure<Show>

Source

pub fn get_target(&self) -> Option<&Target>

Returns the selected target, if any.

Source

pub fn set_target(&mut self, target: Option<Target>) -> &mut Self

Sets the positional target of the report.

Source

pub fn target(self, target: Option<Target>) -> Self

Sets the positional target of the report.

Source

pub fn allservers(self) -> Self

Restricts the report to all servers known to the system.

Source

pub fn server(self, v: impl Into<String>) -> Self

Restricts the report to the named server.

Source

pub fn variable(self, v: impl Into<String>) -> Self

Restricts the report to the specified variable.

Source§

impl Configure<History>

Source

pub fn get_target(&self) -> Option<&Target>

Returns the selected target, if any.

Source

pub fn set_target(&mut self, target: Option<Target>) -> &mut Self

Sets the positional target of the report.

Source

pub fn target(self, target: Option<Target>) -> Self

Sets the positional target of the report.

Source

pub fn allservers(self) -> Self

Restricts the report to all servers known to the system.

Source

pub fn server(self, v: impl Into<String>) -> Self

Restricts the report to the named server.

Source

pub fn variable(self, v: impl Into<String>) -> Self

Restricts the report to the specified variable.

Source§

impl Configure<Patch>

Source

pub fn get_iteration(&self) -> Option<u64>

Returns the targeted history entry, if any.

Source

pub fn set_iteration(&mut self, v: u64) -> &mut Self

Sets --iteration=N.

Source

pub fn iteration(self, v: u64) -> Self

Sets --iteration=N.

Source

pub fn get_comment(&self) -> &str

Returns the comment being set.

Source

pub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self

Sets the comment being set.

Source

pub fn comment(self, v: impl Into<String>) -> Self

Sets the comment being set.

Source

pub fn get_variable(&self) -> &str

Returns the name of the variable whose history is patched.

Source

pub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self

Sets the name of the variable whose history is patched.

Source

pub fn variable(self, v: impl Into<String>) -> Self

Sets the name of the variable whose history is patched.

Trait Implementations§

Source§

impl<T: Clone> Clone for Configure<T>

Source§

fn clone(&self) -> Self

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<T: Debug> Debug for Configure<T>

Source§

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

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

impl<T: Default> Default for Configure<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ParameterizedSpawn<()> for Configure<SetVariable>

Source§

type Output = Child

Source§

type Error = Error

Source§

fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>

Source§

impl ParameterizedSpawn<()> for Configure<UnSetVariable>

Source§

type Output = Child

Source§

type Error = Error

Source§

fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>

Source§

impl ParameterizedSpawn<()> for Configure<Show>

Source§

type Output = Child

Source§

type Error = Error

Source§

fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>

Source§

impl ParameterizedSpawn<()> for Configure<History>

Available on non-crate feature lt2019_2 only.
Source§

type Output = Child

Source§

type Error = Error

Source§

fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>

Source§

impl ParameterizedSpawn<()> for Configure<Patch>

Available on non-crate feature lt2023_2 only.
Source§

type Output = Child

Source§

type Error = Error

Source§

fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>

Source§

impl ParameterizedSpawn<()> for Configure<Help>

Available on non-crate feature lt2023_2 only.
Source§

type Output = Child

Source§

type Error = Error

Source§

fn spawn_with(&mut self, (): ()) -> Result<Self::Output, Self::Error>

Source§

impl<T: SubCommand> SubCommand for Configure<T>

Source§

fn name(&self) -> &str

Source§

fn inject_local_args(&self, command: &mut Command)

Source§

fn global_opts(&self) -> Option<&GlobalOpts>

Source§

fn inject_args(&self, command: &mut Command)

Source§

fn setup_command<S: AsRef<OsStr>>(&self, bin: S) -> Command

Auto Trait Implementations§

§

impl<T> Freeze for Configure<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Configure<T>
where T: RefUnwindSafe,

§

impl<T> Send for Configure<T>
where T: Send,

§

impl<T> Sync for Configure<T>
where T: Sync,

§

impl<T> Unpin for Configure<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Configure<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Configure<T>
where T: UnwindSafe,

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> OutputExt for T
where T: SpawnExt<Output = Child, Error = Error>,

Source§

impl<T, I> ParameterizedOutput<I> for T
where T: ParameterizedSpawn<I, Output = Child, Error = Error>,

Source§

type Error = Error

Source§

fn output_with( &mut self, input: I, ) -> Result<Output, <T as ParameterizedOutput<I>>::Error>

Source§

impl<T> SpawnExt for T

Source§

fn spawn( &mut self, ) -> Result<<T as ParameterizedSpawn<()>>::Output, <T as ParameterizedSpawn<()>>::Error>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.