pub struct Change<M = Unselected, P = Unselected, C = Unselected, S = Unselected> { /* private fields */ }Expand description
Type-safe builder for p4 change.
Create or edit a changelist specification.
The command p4 changelist is an alias for p4 change.
§Syntax
p4 [g-opts] change [-s] [-f | -u] [[-O|-I] changelist]
p4 [g-opts] change -d [-f -s -O] changelist
p4 [g-opts] change -o [-s] [-f] [[-O|-I] changelist]
p4 [g-opts] change -i [-s] [-f | -u]
p4 [g-opts] change -t restricted | public [-U user] [-f|-u|-O|-I] changelist
p4 [g-opts] change -U user [-t restricted | public] [-f] changelist
p4 [g-opts] change -d -f --serverid=X changelistThe four type parameters track, independently and at compile time:
M: the command form —RegularOperationMode,DeleteMode,StdoutMode,StdinMode, orUserOrVisibilityMode;O: the-f/-uoperation —ForceOperationMode,UpdateOperationMode, or theOnly*variants used inside the-t/-Uform;C: the-O/-Ichangelist reference —OriginalChangeListMode/IdentityChangeListMode, or theirOnly*variants;S: the-sarbitrary job status flag (ArbitraryJobStatus).
Start from Change::new (or crate::P4Cli::change), enter a form
with one of Self::delete, Self::stdout, Self::stdin,
Self::visibility, or Self::user (or one of the
Self::force/Self::update/Self::original/
Self::identity/
Self::arbitrary_job_status entry points that select an option of the
plain edit form), and move between compatible forms with the
delete, stdout, stdin, visibility, user, and server_id
transition methods.
Implementations§
Source§impl<O, C> Change<DeleteMode<LocalDeleteMode>, O, C, Unselected>
impl<O, C> Change<DeleteMode<LocalDeleteMode>, O, C, Unselected>
Sourcepub fn arbitrary_job_status(
self,
) -> Change<DeleteMode<LocalDeleteMode>, O, C, ArbitraryJobStatus>
pub fn arbitrary_job_status( self, ) -> Change<DeleteMode<LocalDeleteMode>, O, C, ArbitraryJobStatus>
Selects -s in the delete form.
Source§impl<C, S> Change<DeleteMode<LocalDeleteMode>, Unselected, C, S>
impl<C, S> Change<DeleteMode<LocalDeleteMode>, Unselected, C, S>
Sourcepub fn force(
self,
) -> Change<DeleteMode<LocalDeleteMode>, ForceOperationMode, C, S>
pub fn force( self, ) -> Change<DeleteMode<LocalDeleteMode>, ForceOperationMode, C, S>
Selects -f in the delete form (forcibly delete a submitted
changelist).
Source§impl<O, S> Change<DeleteMode<LocalDeleteMode>, O, Unselected, S>
impl<O, S> Change<DeleteMode<LocalDeleteMode>, O, Unselected, S>
Sourcepub fn original(
self,
) -> Change<DeleteMode<LocalDeleteMode>, O, OriginalChangeListMode, S>
pub fn original( self, ) -> Change<DeleteMode<LocalDeleteMode>, O, OriginalChangeListMode, S>
Selects -O in the delete form (reference by original changelist
number).
Source§impl<O: TransferRemoteDeleteMode> Change<DeleteMode<LocalDeleteMode>, O, Unselected, Unselected>
impl<O: TransferRemoteDeleteMode> Change<DeleteMode<LocalDeleteMode>, O, Unselected, Unselected>
Sourcepub fn server_id(
self,
server_id: impl Into<String>,
) -> Change<DeleteMode<RemoteDeleteMode>, Unselected, Unselected, Unselected>
pub fn server_id( self, server_id: impl Into<String>, ) -> Change<DeleteMode<RemoteDeleteMode>, Unselected, Unselected, Unselected>
Transitions to the remote delete form.
Available from the local delete form as long as neither -s,
-O, nor -u is selected (the remote delete form accepts no
extra options; its -f is built in). A previously selected -f
is simply dropped in favor of the built-in one.
server_id is the server id of the commit server the changelist’s
client is bound to.
Source§impl<O, C> Change<StdoutMode, O, C, Unselected>
impl<O, C> Change<StdoutMode, O, C, Unselected>
Sourcepub fn arbitrary_job_status(
self,
) -> Change<StdoutMode, O, C, ArbitraryJobStatus>
pub fn arbitrary_job_status( self, ) -> Change<StdoutMode, O, C, ArbitraryJobStatus>
Selects -s in the stdout form.
Source§impl<C, S> Change<StdoutMode, Unselected, C, S>
impl<C, S> Change<StdoutMode, Unselected, C, S>
Sourcepub fn force(self) -> Change<StdoutMode, ForceOperationMode, C, S>
pub fn force(self) -> Change<StdoutMode, ForceOperationMode, C, S>
Selects -f in the stdout form.
Source§impl<O, S> Change<StdoutMode, O, Unselected, S>
impl<O, S> Change<StdoutMode, O, Unselected, S>
Sourcepub fn original(self) -> Change<StdoutMode, O, OriginalChangeListMode, S>
pub fn original(self) -> Change<StdoutMode, O, OriginalChangeListMode, S>
Selects -O in the stdout form (reference by original changelist
number).
Sourcepub fn identity(self) -> Change<StdoutMode, O, IdentityChangeListMode, S>
pub fn identity(self) -> Change<StdoutMode, O, IdentityChangeListMode, S>
Selects -I in the stdout form (reference by Identity field).
Source§impl<O> Change<StdinMode, O, Unselected, Unselected>
impl<O> Change<StdinMode, O, Unselected, Unselected>
Sourcepub fn arbitrary_job_status(
self,
) -> Change<StdinMode, O, Unselected, ArbitraryJobStatus>
pub fn arbitrary_job_status( self, ) -> Change<StdinMode, O, Unselected, ArbitraryJobStatus>
Selects -s in the stdin form.
Source§impl<S> Change<StdinMode, Unselected, Unselected, S>
impl<S> Change<StdinMode, Unselected, Unselected, S>
Sourcepub fn force(self) -> Change<StdinMode, ForceOperationMode, Unselected, S>
pub fn force(self) -> Change<StdinMode, ForceOperationMode, Unselected, S>
Selects -f in the stdin form.
Sourcepub fn update(self) -> Change<StdinMode, UpdateOperationMode, Unselected, S>
pub fn update(self) -> Change<StdinMode, UpdateOperationMode, Unselected, S>
Selects -u in the stdin form.
Source§impl<O, C> Change<UserOrVisibilityMode, O, C, Unselected>
impl<O, C> Change<UserOrVisibilityMode, O, C, Unselected>
Sourcepub fn user(self, user: impl Into<String>) -> Self
pub fn user(self, user: impl Into<String>) -> Self
Sets the new owner (-U user) of the changelist.
user is the user the changelist is transferred to.
Sourcepub fn set_user(&mut self, user: impl Into<String>) -> &mut Self
pub fn set_user(&mut self, user: impl Into<String>) -> &mut Self
Sets the new owner (-U user) of the changelist.
user is the user the changelist is transferred to.
Sourcepub fn get_user(&self) -> Option<&str>
pub fn get_user(&self) -> Option<&str>
Returns the new owner (-U user) of the changelist, if set.
Sourcepub fn visibility(self, visibility: Visibility) -> Self
pub fn visibility(self, visibility: Visibility) -> Self
Sets the changelist visibility (-t restricted | public).
visibility selects the new changelist type.
Sourcepub fn set_visibility(&mut self, visibility: Visibility) -> &mut Self
pub fn set_visibility(&mut self, visibility: Visibility) -> &mut Self
Sets the changelist visibility (-t restricted | public).
visibility selects the new changelist type.
Sourcepub fn get_visibility(&self) -> Option<Visibility>
pub fn get_visibility(&self) -> Option<Visibility>
Returns the changelist visibility (-t restricted | public), if set.
Source§impl Change<UserOrVisibilityMode, Unselected, Unselected, Unselected>
impl Change<UserOrVisibilityMode, Unselected, Unselected, Unselected>
Sourcepub fn force(
self,
) -> Change<UserOrVisibilityMode, OnlyForceOperationMode, Unselected, Unselected>
pub fn force( self, ) -> Change<UserOrVisibilityMode, OnlyForceOperationMode, Unselected, Unselected>
Selects -f (force the type/owner change).
Mutually exclusive with -u, -O, and -I.
Sourcepub fn update(
self,
) -> Change<UserOrVisibilityMode, OnlyUpdateOperationMode, Unselected, Unselected>
pub fn update( self, ) -> Change<UserOrVisibilityMode, OnlyUpdateOperationMode, Unselected, Unselected>
Selects -u (update a submitted changelist).
Mutually exclusive with -f, -O, and -I.
Sourcepub fn original(
self,
) -> Change<UserOrVisibilityMode, Unselected, OnlyOriginalChangeListMode, Unselected>
pub fn original( self, ) -> Change<UserOrVisibilityMode, Unselected, OnlyOriginalChangeListMode, Unselected>
Selects -O: interpret the changelist number as the original,
pre-renumber number.
Mutually exclusive with -f, -u, and -I.
Sourcepub fn identity(
self,
) -> Change<UserOrVisibilityMode, Unselected, OnlyIdentityChangeListMode, Unselected>
pub fn identity( self, ) -> Change<UserOrVisibilityMode, Unselected, OnlyIdentityChangeListMode, Unselected>
Selects -I: interpret the changelist number as the Identity field.
Mutually exclusive with -f, -u, and -O.
Source§impl Change<Unselected, Unselected, Unselected, Unselected>
impl Change<Unselected, Unselected, Unselected, 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 change command.
bin is the path to the Perforce command-line executable.
Sourcepub fn delete(
self,
) -> Change<DeleteMode<LocalDeleteMode>, Unselected, Unselected, Unselected>
pub fn delete( self, ) -> Change<DeleteMode<LocalDeleteMode>, Unselected, Unselected, Unselected>
Enters the local delete form: p4 change -d changelist.
Sourcepub fn server_id(
self,
server_id: impl Into<String>,
) -> Change<DeleteMode<RemoteDeleteMode>, Unselected, Unselected, Unselected>
pub fn server_id( self, server_id: impl Into<String>, ) -> Change<DeleteMode<RemoteDeleteMode>, Unselected, Unselected, Unselected>
Enters the remote delete form.
-f is fixed in this form and is injected together with the form;
none of the other options are accepted.
server_id is the server id of the commit server the changelist’s
client is bound to.
Sourcepub fn stdout(self) -> Change<StdoutMode, Unselected, Unselected, Unselected>
pub fn stdout(self) -> Change<StdoutMode, Unselected, Unselected, Unselected>
Enters the stdout form: p4 change -o.
Sourcepub fn stdin(self) -> Change<StdinMode, Unselected, Unselected, Unselected>
pub fn stdin(self) -> Change<StdinMode, Unselected, Unselected, Unselected>
Enters the stdin form: p4 change -i.
Sourcepub fn visibility(
self,
visibility: Visibility,
) -> Change<UserOrVisibilityMode, Unselected, Unselected, Unselected>
pub fn visibility( self, visibility: Visibility, ) -> Change<UserOrVisibilityMode, Unselected, Unselected, Unselected>
Enters the change-type form: p4 change -t restricted | public changelist.
visibility selects the new changelist type; the optional new owner
can be added later with the user builder of the entered form.
Sourcepub fn user(
self,
user: impl Into<String>,
) -> Change<UserOrVisibilityMode, Unselected, Unselected, Unselected>
pub fn user( self, user: impl Into<String>, ) -> Change<UserOrVisibilityMode, Unselected, Unselected, Unselected>
Enters the owner-transfer form: p4 change -U user changelist.
user is the new owner of the empty pending changelist; the optional
visibility can be added later with the visibility builder of the
entered form.
Sourcepub fn arbitrary_job_status(
self,
) -> Change<RegularOperationMode, Unselected, Unselected, ArbitraryJobStatus>
pub fn arbitrary_job_status( self, ) -> Change<RegularOperationMode, Unselected, Unselected, ArbitraryJobStatus>
Selects -s and enters the plain edit form.
Sourcepub fn force(
self,
) -> Change<RegularOperationMode, ForceOperationMode, Unselected, Unselected>
pub fn force( self, ) -> Change<RegularOperationMode, ForceOperationMode, Unselected, Unselected>
Selects -f and enters the plain edit form.
Sourcepub fn update(
self,
) -> Change<RegularOperationMode, UpdateOperationMode, Unselected, Unselected>
pub fn update( self, ) -> Change<RegularOperationMode, UpdateOperationMode, Unselected, Unselected>
Selects -u and enters the plain edit form.
Sourcepub fn original(
self,
) -> Change<RegularOperationMode, Unselected, OriginalChangeListMode, Unselected>
pub fn original( self, ) -> Change<RegularOperationMode, Unselected, OriginalChangeListMode, Unselected>
Selects -O and enters the plain edit form.
Sourcepub fn identity(
self,
) -> Change<RegularOperationMode, Unselected, IdentityChangeListMode, Unselected>
pub fn identity( self, ) -> Change<RegularOperationMode, Unselected, IdentityChangeListMode, Unselected>
Selects -I and enters the plain edit form.
Source§impl<M, P, C, S> Change<M, P, C, S>
impl<M, P, C, S> Change<M, P, C, S>
Sourcepub fn get_global_opts(&self) -> &GlobalOpts
pub fn get_global_opts(&self) -> &GlobalOpts
Returns the global options of this command.
Sourcepub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self
pub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self
Sets the global options of this command.
Sourcepub fn global_opts(self, v: GlobalOpts) -> Self
pub fn global_opts(self, v: GlobalOpts) -> Self
Builder for the global options of this command.
Source§impl<P, C, S> Change<RegularOperationMode, P, C, S>
impl<P, C, S> Change<RegularOperationMode, P, C, S>
Sourcepub fn delete(self) -> Change<DeleteMode<LocalDeleteMode>, P, C, S>where
P: TransferDeleteMode,
C: TransferDeleteMode,
pub fn delete(self) -> Change<DeleteMode<LocalDeleteMode>, P, C, S>where
P: TransferDeleteMode,
C: TransferDeleteMode,
Transitions to the local delete form (-d), preserving every
selected option accepted by that form.
Available when no -u or -I is selected (-d accepts only -f,
-s, and -O).
Sourcepub fn stdout(self) -> Change<StdoutMode, P, C, S>where
P: TransferStdoutMode,
pub fn stdout(self) -> Change<StdoutMode, P, C, S>where
P: TransferStdoutMode,
Transitions to the stdout form (-o), preserving every selected
option accepted by that form.
Available when no -u is selected (-o accepts -f, -s, -O,
and -I).
Source§impl<P: TransferRemoteDeleteMode> Change<RegularOperationMode, P, Unselected, Unselected>
impl<P: TransferRemoteDeleteMode> Change<RegularOperationMode, P, Unselected, Unselected>
Sourcepub fn server_id(
self,
server_id: impl Into<String>,
) -> Change<DeleteMode<RemoteDeleteMode>, Unselected, Unselected, Unselected>
pub fn server_id( self, server_id: impl Into<String>, ) -> Change<DeleteMode<RemoteDeleteMode>, Unselected, Unselected, Unselected>
Transitions to the remote delete form.
Available from the plain edit form as long as neither -u, -s,
-O, nor -I is selected. A previously selected -f is folded
into the form’s built-in -f.
server_id is the server id of the commit server the changelist’s
client is bound to.
Source§impl<O, S> Change<RegularOperationMode, O, Unselected, S>
impl<O, S> Change<RegularOperationMode, O, Unselected, S>
Sourcepub fn stdin(self) -> Change<StdinMode, O, Unselected, S>
pub fn stdin(self) -> Change<StdinMode, O, Unselected, S>
Transitions to the stdin form (-i), preserving every selected
option accepted by that form.
Available only when no -O or -I is selected (-i accepts -s,
-f, and -u, but no changelist reference).
Source§impl<O, C> Change<RegularOperationMode, O, C, Unselected>
impl<O, C> Change<RegularOperationMode, O, C, Unselected>
Sourcepub fn arbitrary_job_status(
self,
) -> Change<RegularOperationMode, O, C, ArbitraryJobStatus>
pub fn arbitrary_job_status( self, ) -> Change<RegularOperationMode, O, C, ArbitraryJobStatus>
Selects -s: jobs may be assigned arbitrary status values on
submission.
Source§impl<C, S> Change<RegularOperationMode, Unselected, C, S>
impl<C, S> Change<RegularOperationMode, Unselected, C, S>
Sourcepub fn force(self) -> Change<RegularOperationMode, ForceOperationMode, C, S>
pub fn force(self) -> Change<RegularOperationMode, ForceOperationMode, C, S>
Selects -f (force editing of submitted changelists).
Mutually exclusive with -u.
Sourcepub fn update(self) -> Change<RegularOperationMode, UpdateOperationMode, C, S>
pub fn update(self) -> Change<RegularOperationMode, UpdateOperationMode, C, S>
Selects -u (update a submitted changelist).
Mutually exclusive with -f.
Source§impl<O, S> Change<RegularOperationMode, O, Unselected, S>
impl<O, S> Change<RegularOperationMode, O, Unselected, S>
Sourcepub fn original(
self,
) -> Change<RegularOperationMode, O, OriginalChangeListMode, S>
pub fn original( self, ) -> Change<RegularOperationMode, O, OriginalChangeListMode, S>
Selects -O: interpret the changelist number as the original,
pre-renumber number.
Mutually exclusive with -I.
Sourcepub fn identity(
self,
) -> Change<RegularOperationMode, O, IdentityChangeListMode, S>
pub fn identity( self, ) -> Change<RegularOperationMode, O, IdentityChangeListMode, S>
Selects -I: interpret the changelist number as the Identity field.
Mutually exclusive with -O.
Source§impl<O, C> Change<RegularOperationMode, O, C, Unselected>
impl<O, C> Change<RegularOperationMode, O, C, Unselected>
Sourcepub fn visibility(
self,
visibility: Visibility,
) -> Change<UserOrVisibilityMode, <(O, C) as TransferUVMode>::P, <(O, C) as TransferUVMode>::C, Unselected>where
(O, C): TransferUVMode,
pub fn visibility(
self,
visibility: Visibility,
) -> Change<UserOrVisibilityMode, <(O, C) as TransferUVMode>::P, <(O, C) as TransferUVMode>::C, Unselected>where
(O, C): TransferUVMode,
Transitions to the change-type form (-t type), preserving a
selected -f, -u, -O, or -I as the form’s single allowed
extra option.
Available only when -s is not selected (the -t / -U form does
not accept it), and at most one of -f, -u, -O, -I is
selected.
visibility selects the new changelist type.
Sourcepub fn user(
self,
user: impl Into<String>,
) -> Change<UserOrVisibilityMode, <(O, C) as TransferUVMode>::P, <(O, C) as TransferUVMode>::C, Unselected>where
(O, C): TransferUVMode,
pub fn user(
self,
user: impl Into<String>,
) -> Change<UserOrVisibilityMode, <(O, C) as TransferUVMode>::P, <(O, C) as TransferUVMode>::C, Unselected>where
(O, C): TransferUVMode,
Transitions to the owner-transfer form (-U user), preserving a
selected -f, -u, -O, or -I as the form’s single allowed
extra option.
Available only when -s is not selected (the -t / -U form does
not accept it), and at most one of -f, -u, -O, -I is
selected.
user is the new owner of the empty pending changelist.
Trait Implementations§
Source§impl<O, C, S> ParameterizedSpawn<()> for Change<RegularOperationMode, O, C, S>
impl<O, C, S> ParameterizedSpawn<()> for Change<RegularOperationMode, O, C, S>
Source§impl<O, C, S> ParameterizedSpawn<()> for Change<StdoutMode, O, C, S>
impl<O, C, S> ParameterizedSpawn<()> for Change<StdoutMode, O, C, S>
Source§impl<O, S> ParameterizedSpawn<()> for Change<StdinMode, O, Unselected, S>where
O: ExclusiveOption,
S: ExclusiveOption,
impl<O, S> ParameterizedSpawn<()> for Change<StdinMode, O, Unselected, S>where
O: ExclusiveOption,
S: ExclusiveOption,
Source§fn spawn_with(&mut self, _: ()) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, _: ()) -> Result<Self::Output, Self::Error>
Spawns p4 change -i with a piped standard input stream (and piped
standard output and error streams); write the changelist
specification to the returned Child’s stdin handle.
type Output = Child
type Error = Error
Source§impl<M, O, C, S, I> ParameterizedSpawn<(I,)> for Change<M, O, C, S>where
M: ExclusiveOption + TakesChangeList,
O: ExclusiveOption,
C: ExclusiveOption,
S: ExclusiveOption,
I: AsRef<OsStr>,
impl<M, O, C, S, I> ParameterizedSpawn<(I,)> for Change<M, O, C, S>where
M: ExclusiveOption + TakesChangeList,
O: ExclusiveOption,
C: ExclusiveOption,
S: ExclusiveOption,
I: AsRef<OsStr>,
Source§fn spawn_with(
&mut self,
(changelist): (I,),
) -> Result<Self::Output, Self::Error>
fn spawn_with( &mut self, (changelist): (I,), ) -> Result<Self::Output, Self::Error>
Spawns p4 change with the given changelist argument as a child
process with piped standard output and error streams; use the
returned Child handle to wait for it or interact with it.
The changelist argument is a changelist number, optionally prefixed
by the form’s reference option semantics (for example an original
pre-renumber number under -O).
type Output = Child
type Error = Error
Source§impl<O, S> ParameterizedSpawn<(Stdio,)> for Change<StdinMode, O, Unselected, S>where
O: ExclusiveOption,
S: ExclusiveOption,
impl<O, S> ParameterizedSpawn<(Stdio,)> for Change<StdinMode, O, Unselected, S>where
O: ExclusiveOption,
S: ExclusiveOption,
Source§fn spawn_with(&mut self, (stdio): (Stdio,)) -> Result<Self::Output, Self::Error>
fn spawn_with(&mut self, (stdio): (Stdio,)) -> Result<Self::Output, Self::Error>
Spawns p4 change -i with the given standard input configuration
and piped standard output and error streams; use the returned
Child handle to wait for it or interact with it.
Pass Stdio::piped() to obtain a writable child.stdin handle and
feed the changelist specification into it; pass Stdio::inherit()
to read the specification from the spawning process’s own standard
input.