Skip to main content

Depot

Struct Depot 

Source
pub struct Depot<M = Unselected> { /* private fields */ }
Expand description

p4 [g-opts] depot [-t type] depotname

p4 [g-opts] depot -d [-f] depotname

p4 [g-opts] depot -o [-t type] depotname

p4 [g-opts] depot -i

Create, edit, or delete a depot specification.

A branch, depot, label, and workspace cannot share the same name.

The M type parameter tracks the command form at compile time. The default Unselected state is the regular form with no options; Self::delete, Self::stdout, and Self::stdin transition to the Delete, Stdout, and Stdin modes , while Self::depot_type transitions to the Regular mode carrying -t type.

Implementations§

Source§

impl Depot<Unselected>

Source

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

Creates a new p4 depot command.

bin is the path to the Perforce command-line executable.

Source

pub fn delete(self) -> Depot<Delete>

§Description

-d depotname

Delete the depot depotname.

A classic depot must not contain any files. The P4 Server user with the super access level can permanently remove files with p4 obliterate.

A stream depot must not contain any streams. A P4 Server user with the admin access level can can use the --obliterate option of p4 stream to permanently remove a stream.

If the depot is remote, p4 obliterate must still be run: no files are deleted, but any outstanding client or label records referring to that depot are eliminated.

The name of a depot cannot be the same as the name of a branch, client workspace, or label.

Transitions this command to the Delete mode.

Source

pub fn stdout(self) -> Depot<Stdout>

§Description

-o depotname

Write a depot specification to standard output.

Transitions this command to the Stdout mode.

Source

pub fn stdin(self) -> Depot<Stdin>

§Description

-i

Read a depot specification from standard input, or from a file in the case of p4 depot -o -t stream mystreamdepot2 > filename where content of filename is the depot spec.

Transitions this command to the Stdin mode.

Source

pub fn depot_type(self, v: DepotType) -> Depot<Regular>

§Description

-t type

The type of the depot: local, remote, spec, stream, unload, archive, or tangent. To support Git workflows, a special type is graph.

Transitions this command to the Regular mode with the depot type set.

Source§

impl Depot<Delete>

Source

pub fn get_force(&self) -> bool

§Description

-f

By default, when you delete a depot, the directory specified by the Map field (typically under P4ROOT) must be empty. Use the -f option to remove all files even if the directory is not empty.

The P4 Server will not delete files on disk if they are referenced elsewhere (due to being branched or integrated to another depot as a lazy copy). You should not remove referenced files from disk manually using operating system commands. For more information, see Deleting depots.

Source

pub fn set_force(&mut self, v: bool) -> &mut Self

§Description

-f

By default, when you delete a depot, the directory specified by the Map field (typically under P4ROOT) must be empty. Use the -f option to remove all files even if the directory is not empty.

The P4 Server will not delete files on disk if they are referenced elsewhere (due to being branched or integrated to another depot as a lazy copy). You should not remove referenced files from disk manually using operating system commands. For more information, see Deleting depots.

Source

pub fn force(self, v: bool) -> Self

§Description

-f

By default, when you delete a depot, the directory specified by the Map field (typically under P4ROOT) must be empty. Use the -f option to remove all files even if the directory is not empty.

The P4 Server will not delete files on disk if they are referenced elsewhere (due to being branched or integrated to another depot as a lazy copy). You should not remove referenced files from disk manually using operating system commands. For more information, see Deleting depots.

Source§

impl Depot<Regular>

Source

pub fn get_depot_type(&self) -> Option<DepotType>

§Description

-t type

The type of the depot: local, remote, spec, stream, unload, archive, or tangent. To support Git workflows, a special type is graph.

Source

pub fn set_depot_type(&mut self, v: DepotType) -> &mut Self

§Description

-t type

The type of the depot: local, remote, spec, stream, unload, archive, or tangent. To support Git workflows, a special type is graph.

Source

pub fn depot_type(self, v: DepotType) -> Self

§Description

-t type

The type of the depot: local, remote, spec, stream, unload, archive, or tangent. To support Git workflows, a special type is graph.

Source

pub fn stdout(self) -> Depot<Stdout>

§Description

-o depotname

Write a depot specification to standard output.

Transitions this command to the Stdout mode, preserving the selected depot type.

Source§

impl Depot<Stdout>

Source

pub fn get_depot_type(&self) -> Option<DepotType>

§Description

-t type

The type of the depot: local, remote, spec, stream, unload, archive, or tangent. To support Git workflows, a special type is graph.

Source

pub fn set_depot_type(&mut self, v: DepotType) -> &mut Self

§Description

-t type

The type of the depot: local, remote, spec, stream, unload, archive, or tangent. To support Git workflows, a special type is graph.

Source

pub fn depot_type(self, v: DepotType) -> Self

§Description

-t type

The type of the depot: local, remote, spec, stream, unload, archive, or tangent. To support Git workflows, a special type is graph.

Source§

impl<M: ExclusiveOption> Depot<M>

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 get_global_opts(&self) -> &GlobalOpts

§Description

g-opts

See Global options.

Source

pub fn set_global_opts(&mut self, v: GlobalOpts) -> &mut Self

§Description

g-opts

See Global options.

Source

pub fn global_opts(self, v: GlobalOpts) -> Self

§Description

g-opts

See Global options.

Trait Implementations§

Source§

impl<M: Clone> Clone for Depot<M>

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<M: Debug> Debug for Depot<M>

Source§

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

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

impl<M: Default> Default for Depot<M>

Source§

fn default() -> Self

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

impl ParameterizedSpawn<()> for Depot<Stdin>

Source§

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

Spawns p4 depot -i with a piped standard input stream (and piped standard output and error streams); write the depot specification to the returned Child’s stdin handle.

Source§

type Output = Child

Source§

type Error = Error

Source§

impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Unselected>

Source§

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

Spawns p4 depot depotname with the given depot name as a child process with piped standard output and error streams; use the returned Child handle to wait for it or interact with it.

Source§

type Output = Child

Source§

type Error = Error

Source§

impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Delete>

Source§

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

Spawns p4 depot -d [-f] depotname with the given depot name as a child process with piped standard output and error streams; use the returned Child handle to wait for it or interact with it.

Source§

type Output = Child

Source§

type Error = Error

Source§

impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Stdout>

Source§

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

Spawns p4 depot -o [-t type] depotname with the given depot name as a child process with piped standard output and error streams; use the returned Child handle to wait for it or interact with it.

Source§

type Output = Child

Source§

type Error = Error

Source§

impl<I: AsRef<OsStr>> ParameterizedSpawn<(I,)> for Depot<Regular>

Available on non-crate feature lt2015_2 only.
Source§

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

Spawns p4 depot [-t type] depotname with the given depot name as a child process with piped standard output and error streams; use the returned Child handle to wait for it or interact with it.

Source§

type Output = Child

Source§

type Error = Error

Source§

impl ParameterizedSpawn<(Stdio,)> for Depot<Stdin>

Source§

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

Spawns p4 depot -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 depot specification into it; pass Stdio::inherit() to read the specification from the spawning process’s own standard input.

Source§

type Output = Child

Source§

type Error = Error

Source§

impl<M: ExclusiveOption> SubCommand for Depot<M>

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<M> Freeze for Depot<M>
where M: Freeze,

§

impl<M> RefUnwindSafe for Depot<M>
where M: RefUnwindSafe,

§

impl<M> Send for Depot<M>
where M: Send,

§

impl<M> Sync for Depot<M>
where M: Sync,

§

impl<M> Unpin for Depot<M>
where M: Unpin,

§

impl<M> UnsafeUnpin for Depot<M>
where M: UnsafeUnpin,

§

impl<M> UnwindSafe for Depot<M>
where M: 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, T1> OutputExt1<T1> for T
where T: SpawnExt1<T1, Output = Child, Error = Error>,

Source§

fn output( &mut self, a: T1, ) -> Result<Output, <T as ParameterizedSpawn<(T1,)>>::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, T1> SpawnExt1<T1> for T

Source§

fn spawn( &mut self, a: T1, ) -> Result<<T as ParameterizedSpawn<(T1,)>>::Output, <T as ParameterizedSpawn<(T1,)>>::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.