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>
impl Configure<Unselected>
Sourcepub fn new(bin: impl Into<PathBuf>, global_opts: GlobalOpts) -> Self
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.
Sourcepub fn set(
self,
variable: impl Into<String>,
value: impl Into<String>,
) -> Configure<SetVariable>
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.
Sourcepub fn unset(self, variable: impl Into<String>) -> Configure<UnSetVariable>
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.
Sourcepub fn show(self) -> Configure<Show>
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.
Sourcepub fn history(self) -> Configure<History>
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§impl<T: SubCommand> Configure<T>
impl<T: SubCommand> Configure<T>
Source§impl Configure<SetVariable>
impl Configure<SetVariable>
Sourcepub fn get_server_id(&self) -> Option<&str>
pub fn get_server_id(&self) -> Option<&str>
Returns the server whose configuration is being set, if any.
Sourcepub fn set_server_id(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_server_id(&mut self, v: impl Into<String>) -> &mut Self
Sets the [serverid#] prefix.
Sourcepub fn get_variable(&self) -> &str
pub fn get_variable(&self) -> &str
Returns the name of the variable being set.
Sourcepub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self
Sets the name of the variable being set.
Sourcepub fn get_comment(&self) -> Option<&str>
pub fn get_comment(&self) -> Option<&str>
Returns the comment attached to the change, if any.
Sourcepub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self
Sets --comment=comment.
Source§impl Configure<UnSetVariable>
impl Configure<UnSetVariable>
Sourcepub fn get_server_id(&self) -> Option<&str>
pub fn get_server_id(&self) -> Option<&str>
Returns the server whose configuration is being unset, if any.
Sourcepub fn set_server_id(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_server_id(&mut self, v: impl Into<String>) -> &mut Self
Sets the [serverid#] prefix.
Sourcepub fn get_variable(&self) -> &str
pub fn get_variable(&self) -> &str
Returns the name of the variable being unset.
Sourcepub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self
Sets the name of the variable being unset.
Sourcepub fn get_comment(&self) -> Option<&str>
pub fn get_comment(&self) -> Option<&str>
Returns the comment attached to the change, if any.
Sourcepub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self
Sets --comment=comment.
Source§impl Configure<Show>
impl Configure<Show>
Sourcepub fn get_target(&self) -> Option<&Target>
pub fn get_target(&self) -> Option<&Target>
Returns the selected target, if any.
Sourcepub fn set_target(&mut self, target: Option<Target>) -> &mut Self
pub fn set_target(&mut self, target: Option<Target>) -> &mut Self
Sets the positional target of the report.
Sourcepub fn allservers(self) -> Self
pub fn allservers(self) -> Self
Restricts the report to all servers known to the system.
Source§impl Configure<History>
impl Configure<History>
Sourcepub fn get_target(&self) -> Option<&Target>
pub fn get_target(&self) -> Option<&Target>
Returns the selected target, if any.
Sourcepub fn set_target(&mut self, target: Option<Target>) -> &mut Self
pub fn set_target(&mut self, target: Option<Target>) -> &mut Self
Sets the positional target of the report.
Sourcepub fn allservers(self) -> Self
pub fn allservers(self) -> Self
Restricts the report to all servers known to the system.
Source§impl Configure<Patch>
impl Configure<Patch>
Sourcepub fn get_iteration(&self) -> Option<u64>
pub fn get_iteration(&self) -> Option<u64>
Returns the targeted history entry, if any.
Sourcepub fn set_iteration(&mut self, v: u64) -> &mut Self
pub fn set_iteration(&mut self, v: u64) -> &mut Self
Sets --iteration=N.
Sourcepub fn get_comment(&self) -> &str
pub fn get_comment(&self) -> &str
Returns the comment being set.
Sourcepub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_comment(&mut self, v: impl Into<String>) -> &mut Self
Sets the comment being set.
Sourcepub fn get_variable(&self) -> &str
pub fn get_variable(&self) -> &str
Returns the name of the variable whose history is patched.
Sourcepub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self
pub fn set_variable(&mut self, v: impl Into<String>) -> &mut Self
Sets the name of the variable whose history is patched.
Trait Implementations§
Source§impl ParameterizedSpawn<()> for Configure<SetVariable>
impl ParameterizedSpawn<()> for Configure<SetVariable>
Source§impl ParameterizedSpawn<()> for Configure<UnSetVariable>
impl ParameterizedSpawn<()> for Configure<UnSetVariable>
Source§impl ParameterizedSpawn<()> for Configure<History>
Available on non-crate feature lt2019_2 only.
impl ParameterizedSpawn<()> for Configure<History>
lt2019_2 only.Source§impl ParameterizedSpawn<()> for Configure<Patch>
Available on non-crate feature lt2023_2 only.
impl ParameterizedSpawn<()> for Configure<Patch>
lt2023_2 only.