Skip to main content

Admin

Struct Admin 

Source
pub struct Admin<T: SubCommand> { /* private fields */ }
Expand description

A p4 admin operation wrapping a selected SubCommand.

Implementations§

Source§

impl<T: SubCommand> Admin<T>

Source

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

Creates a p4 admin command wrapping the given subcommand.

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

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.

Source§

impl<C: ExclusiveOption> Admin<CheckPoint<C>>

Source

pub fn get_parallel(&self) -> bool

§Description

-p

Requests a parallel checkpoint.

Source

pub fn set_parallel(&mut self, parallel: bool) -> &mut Self

§Description

-p

Requests a parallel checkpoint.

Source

pub fn parallel(self, parallel: bool) -> Self

§Description

-p

Requests a parallel checkpoint.

Source

pub fn get_threads(&self) -> Option<&u32>

§Description

-N threads

Specifies the number of threads to use during the parallel request.

Source

pub fn set_threads(&mut self, threads: u32) -> &mut Self

§Description

-N threads

Specifies the number of threads to use during the parallel request.

Source

pub fn threads(self, threads: u32) -> Self

§Description

-N threads

Specifies the number of threads to use during the parallel request.

Source

pub fn get_multiple_files(&self) -> bool

§Description

-m

Uses multiple files if there are multiple parallel threads because db.checkpoint.threads is greater than 1 or the -N option is greater than 1. See Parallel checkpointing, dumping and recovery in the P4 Server Administration Documentation. See also Checkpoint examples.

Source

pub fn set_multiple_files(&mut self, multiple_files: bool) -> &mut Self

§Description

-m

Uses multiple files if there are multiple parallel threads because db.checkpoint.threads is greater than 1 or the -N option is greater than 1. See Parallel checkpointing, dumping and recovery in the P4 Server Administration Documentation. See also Checkpoint examples.

Source

pub fn multiple_files(self, multiple_files: bool) -> Self

§Description

-m

Uses multiple files if there are multiple parallel threads because db.checkpoint.threads is greater than 1 or the -N option is greater than 1. See Parallel checkpointing, dumping and recovery in the P4 Server Administration Documentation. See also Checkpoint examples.

Source§

impl Admin<CheckPoint<Unselected>>

Source

pub fn compress_both(self) -> Admin<CheckPoint<Both>>

§Description

-z

Save the checkpoint and journal file in compressed format. The .gz suffix is appended to compressed journals and checkpoint files, which are in gzip format. If you do not specify -z or -Z, no compression occurs.

Source

pub fn compress_checkpoint_only(self) -> Admin<CheckPoint<CheckPointOnly>>

§Description

-Z

For p4 admin checkpoint -Z, save the checkpoint in compressed format, but leave the journal uncompressed for use by replica servers. The .gz suffix is appended to compressed journals and checkpoint files, which are in gzip format. If you do not specify -z or -Z, no compression occurs.

Source§

impl Admin<Journal>

Source

pub fn get_gzip(&self) -> bool

§Description

-z

Save the journal file in compressed format. The .gz suffix is appended to compressed journals and checkpoint files, which are in gzip format. If you do not specify -z, no compression occurs.

Source

pub fn set_gzip(&mut self, gzip: bool) -> &mut Self

§Description

-z

Save the journal file in compressed format. The .gz suffix is appended to compressed journals and checkpoint files, which are in gzip format. If you do not specify -z, no compression occurs.

Source

pub fn gzip(self, gzip: bool) -> Self

§Description

-z

Save the journal file in compressed format. The .gz suffix is appended to compressed journals and checkpoint files, which are in gzip format. If you do not specify -z, no compression occurs.

Source§

impl Admin<UpdateSpecDepot<Unselected>>

Source

pub fn all(self) -> Admin<UpdateSpecDepot<All>>

§Description

-a

For p4 admin updatespecdepot -a, update the spec depot with all current forms.

Source

pub fn specified_type( self, specified_type: SpecifiedType, ) -> Admin<UpdateSpecDepot<Selected>>

§Description

-s type

For p4 admin updatespecdepot -s, update the spec depot with forms of the specified type, where type is one of client, depot, repo, branch, label, typemap, group, user, job, stream, triggers, protect, server, license, or jobspec.

Source§

impl Admin<UpdateSpecDepot<Selected>>

Source

pub fn get_specified_type(&self) -> &SpecifiedType

§Description

-s type

For p4 admin updatespecdepot -s, update the spec depot with forms of the specified type, where type is one of client, depot, repo, branch, label, typemap, group, user, job, stream, triggers, protect, server, license, or jobspec.

Source

pub fn set_specified_type(&mut self, specified_type: SpecifiedType) -> &mut Self

§Description

-s type

For p4 admin updatespecdepot -s, update the spec depot with forms of the specified type, where type is one of client, depot, repo, branch, label, typemap, group, user, job, stream, triggers, protect, server, license, or jobspec.

Source§

impl Admin<ResetPassword<Unselected>>

Source

pub fn all(self) -> Admin<ResetPassword<All>>

§Description

-a

All users.

Source

pub fn user(self, user: impl Into<String>) -> Admin<ResetPassword<User>>

§Description

-u user

The specified user.

Source§

impl Admin<ResetPassword<User>>

Source

pub fn get_user(&self) -> &str

§Description

-u user

The specified user.

Source

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

§Description

-u user

The specified user.

Source§

impl<T: ExclusiveOption> Admin<ResetPassword<T>>

Source

pub fn get_super_user(&self) -> bool

§Description

-l

Super user.

Source

pub fn set_super_user(&mut self, super_user: bool) -> &mut Self

§Description

-l

Super user.

Source

pub fn super_user(self, super_user: bool) -> Self

§Description

-l

Super user.

Source§

impl Admin<ReplicaFilterReconcile<Unselected>>

Source

pub fn restrict_only(self) -> Admin<ReplicaFilterReconcile<RestrictOnly>>

§Description

–restrict-only

Reconcile the replica database by only removing applicable database records.

Source

pub fn expand_only(self) -> Admin<ReplicaFilterReconcile<ExpandOnly>>

§Description

–expand-only

Reconcile the replica database by only adding applicable database records.

Trait Implementations§

Source§

impl<T: Clone + SubCommand> Clone for Admin<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 + SubCommand> Debug for Admin<T>

Source§

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

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

impl<T: Default + SubCommand> Default for Admin<T>

Source§

fn default() -> Self

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

impl ParameterizedSpawn for Admin<Stop>

Source§

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

Spawns p4 admin stop 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl ParameterizedSpawn for Admin<Restart>

Source§

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

Spawns p4 admin restart 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl<S: ExclusiveOption> ParameterizedSpawn for Admin<UpdateSpecDepot<S>>

Source§

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

Spawns p4 admin updatespecdepot 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl<T: ExclusiveOption> ParameterizedSpawn for Admin<ResetPassword<T>>

Source§

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

Spawns p4 admin resetpassword 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl ParameterizedSpawn for Admin<SetLdapUsers>

Available on non-crate feature lt2015_1 only.
Source§

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

Spawns p4 admin setldapusers 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl ParameterizedSpawn for Admin<EndJournal>

Available on non-crate feature lt2018_1 only.
Source§

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

Spawns p4 admin endjournal 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl ParameterizedSpawn for Admin<SysInfo>

Available on non-crate feature lt2023_1 only.
Source§

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

Spawns p4 admin sysinfo 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl ParameterizedSpawn for Admin<ResourceMonitor>

Available on non-crate feature lt2023_1 only.
Source§

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

Spawns p4 admin resource-monitor 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 Input<'a> = ()

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl<C: ExclusiveOption> ParameterizedSpawn for Admin<CheckPoint<C>>

Source§

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

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

Pass Some(prefix) to name the checkpoint with the given prefix, or None to use the default checkpoint name.

Source§

type Input<'a> = &'a OsStr

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl ParameterizedSpawn for Admin<Journal>

Source§

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

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

Pass Some(prefix) to name the journal with the given prefix, or None to use the default journal name.

Source§

type Input<'a> = &'a OsStr

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl<M: ExclusiveOption> ParameterizedSpawn for Admin<ReplicaFilterReconcile<M>>

Available on non-crate feature lt2025_2 only.
Source§

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

Spawns p4 admin replica-filter-reconcile for the given tables as a child process with piped standard output and error streams; use the returned Child handle to wait for it or interact with it.

Pass an empty slice to reconcile all applicable database tables.

Source§

type Input<'a> = &'a [&'a OsStr]

Source§

type Output<'a> = Child

Source§

type Error = Error

Source§

impl<C: ExclusiveOption> SpawnExt for Admin<CheckPoint<C>>

Source§

fn spawn<'a>(&mut self) -> Result<Self::Output<'a>, Self::Error>

Source§

impl SpawnExt for Admin<Journal>

Source§

fn spawn<'a>(&mut self) -> Result<Self::Output<'a>, Self::Error>

Source§

impl<T: SubCommand> SubCommand for Admin<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 Admin<T>
where T: Freeze,

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Admin<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: for<'a> SpawnExt<Output<'a> = Child, Error = Error>,

Source§

impl<T, T1> OutputExt1<T1> for T
where T: for<'a> ParameterizedOutput<Input<'a> = T1>,

Source§

fn output<'a>( &mut self, a: T1, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a,

Source§

impl<T, T1, T2> OutputExt2<T1, T2> for T
where T: for<'a> ParameterizedOutput<Input<'a> = (T1, T2)>,

Source§

fn output<'a>( &mut self, a: T1, b: T2, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a, T2: 'a,

Source§

impl<T, T1, T2, T3> OutputExt3<T1, T2, T3> for T
where T: for<'a> ParameterizedOutput<Input<'a> = (T1, T2, T3)>,

Source§

fn output<'a>( &mut self, a: T1, b: T2, c: T3, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a, T2: 'a, T3: 'a,

Source§

impl<T, T1, T2, T3, T4> OutputExt4<T1, T2, T3, T4> for T
where T: for<'a> ParameterizedOutput<Input<'a> = (T1, T2, T3, T4)>,

Source§

fn output<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a, T2: 'a, T3: 'a, T4: 'a,

Source§

impl<T, T1, T2, T3, T4, T5> OutputExt5<T1, T2, T3, T4, T5> for T
where T: for<'a> ParameterizedOutput<Input<'a> = (T1, T2, T3, T4, T5)>,

Source§

fn output<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a,

Source§

impl<T, T1, T2, T3, T4, T5, T6> OutputExt6<T1, T2, T3, T4, T5, T6> for T
where T: for<'a> ParameterizedOutput<Input<'a> = (T1, T2, T3, T4, T5, T6)>,

Source§

fn output<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, f: T6, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a,

Source§

impl<T, T1, T2, T3, T4, T5, T6, T7> OutputExt7<T1, T2, T3, T4, T5, T6, T7> for T
where T: for<'a> ParameterizedOutput<Input<'a> = (T1, T2, T3, T4, T5, T6, T7)>,

Source§

fn output<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a,

Source§

impl<T, T1, T2, T3, T4, T5, T6, T7, T8> OutputExt8<T1, T2, T3, T4, T5, T6, T7, T8> for T

Source§

fn output<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, ) -> Result<Output, <T as ParameterizedOutput>::Error>
where T1: 'a, T2: 'a, T3: 'a, T4: 'a, T5: 'a, T6: 'a, T7: 'a, T8: 'a,

Source§

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

Source§

type Input<'a> = <T as ParameterizedSpawn>::Input<'a>

Source§

type Error = Error

Source§

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

Source§

impl<T> SpawnExt for T
where T: for<'a> ParameterizedSpawn<Input<'a> = ()>,

Source§

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

Source§

impl<T, T1> SpawnExt1<T1> for T
where T: for<'a> ParameterizedSpawn<Input<'a> = T1>,

Source§

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

Source§

impl<T, T1, T2> SpawnExt2<T1, T2> for T
where T: for<'a> ParameterizedSpawn<Input<'a> = (T1, T2)>,

Source§

fn spawn<'a>( &mut self, a: T1, b: T2, ) -> Result<<T as ParameterizedSpawn>::Output<'a>, <T as ParameterizedSpawn>::Error>

Source§

impl<T, T1, T2, T3> SpawnExt3<T1, T2, T3> for T
where T: for<'a> ParameterizedSpawn<Input<'a> = (T1, T2, T3)>,

Source§

fn spawn<'a>( &mut self, a: T1, b: T2, c: T3, ) -> Result<<T as ParameterizedSpawn>::Output<'a>, <T as ParameterizedSpawn>::Error>

Source§

impl<T, T1, T2, T3, T4> SpawnExt4<T1, T2, T3, T4> for T
where T: for<'a> ParameterizedSpawn<Input<'a> = (T1, T2, T3, T4)>,

Source§

fn spawn<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, ) -> Result<<T as ParameterizedSpawn>::Output<'a>, <T as ParameterizedSpawn>::Error>

Source§

impl<T, T1, T2, T3, T4, T5> SpawnExt5<T1, T2, T3, T4, T5> for T
where T: for<'a> ParameterizedSpawn<Input<'a> = (T1, T2, T3, T4, T5)>,

Source§

fn spawn<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, ) -> Result<<T as ParameterizedSpawn>::Output<'a>, <T as ParameterizedSpawn>::Error>

Source§

impl<T, T1, T2, T3, T4, T5, T6> SpawnExt6<T1, T2, T3, T4, T5, T6> for T
where T: for<'a> ParameterizedSpawn<Input<'a> = (T1, T2, T3, T4, T5, T6)>,

Source§

fn spawn<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, f: T6, ) -> Result<<T as ParameterizedSpawn>::Output<'a>, <T as ParameterizedSpawn>::Error>

Source§

impl<T, T1, T2, T3, T4, T5, T6, T7> SpawnExt7<T1, T2, T3, T4, T5, T6, T7> for T
where T: for<'a> ParameterizedSpawn<Input<'a> = (T1, T2, T3, T4, T5, T6, T7)>,

Source§

fn spawn<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, ) -> Result<<T as ParameterizedSpawn>::Output<'a>, <T as ParameterizedSpawn>::Error>

Source§

impl<T, T1, T2, T3, T4, T5, T6, T7, T8> SpawnExt8<T1, T2, T3, T4, T5, T6, T7, T8> for T

Source§

fn spawn<'a>( &mut self, a: T1, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, ) -> Result<<T as ParameterizedSpawn>::Output<'a>, <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.