Skip to main content

Extension

Struct Extension 

Source
pub struct Extension<T: ExclusiveOption> { /* private fields */ }
Expand description

A p4 extension command with a selected operation.

§Syntax

p4 [g-opts] extension --sample extName
p4 [g-opts] extension --package dir [--sign keyDir]
p4 [g-opts] extension --install extName.p4-extension [--yes]
p4 [g-opts] extension --install certificateFile --cert [--comment]
p4 [g-opts] extension --delete extFQN [--name instName] [--revision=n] [--path FileSpec] [--yes]
p4 [g-opts] extension --delete fingerprint --cert
p4 [g-opts] extension --configure extFQN [--revision=n] [-o | -i]
p4 [g-opts] extension --configure extFQN [--revision=n] [-o | -i] --name instName
p4 [g-opts] extension --run instName [extArguments]
p4 [g-opts] extension --list --type type [--path FileSpec]

Manages the installation, versioning, and configuration of extensions. The type parameter selects the operation, such as Sample, Package, Install, Delete, Configure, Run, or List.

Implementations§

Source§

impl<T: ExclusiveOption> Extension<T>

Source

pub fn get_bin(&self) -> &Path

Returns the path of the p4 binary.

Source

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

Sets the path of the p4 binary.

Source

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

Sets the path of the p4 binary.

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 Extension<Sample>

Source

pub fn get_name(&self) -> &str

Returns the name of the extension skeleton to create.

Source

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

Sets the name of the extension skeleton to create.

Source

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

Sets the name of the extension skeleton to create.

Source§

impl Extension<Package>

Source

pub fn get_dir(&self) -> &str

Returns the directory of extension files to package.

Source

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

Sets the directory of extension files to package.

Source

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

Sets the directory of extension files to package.

Source

pub fn get_sign(&self) -> Option<&String>

§Description

–sign keyDir

Can be supplied in --package.

Source

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

§Description

–sign keyDir

Can be supplied in --package.

Source

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

§Description

–sign keyDir

Can be supplied in --package.

Source§

impl Extension<Install<Unselected>>

Source

pub fn get_file(&self) -> &str

Returns the packaged extension or certificate file to install.

Source

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

Sets the packaged extension or certificate file to install.

Source

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

Sets the packaged extension or certificate file to install.

Source

pub fn yes(self) -> Extension<Install<InstallExt>>

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

pub fn cert(self) -> Extension<Install<InstallCert>>

§Description

–cert

Can be supplied in --install or --delete. For example, p4 extension --install path/certificate.txt --cert --comment "We trust ACTools".

Source

pub fn comment(self, v: impl Into<String>) -> Extension<Install<InstallCert>>

§Description

–comment

Can be supplied in --install or --delete. For example, p4 extension --install path/certificate.txt --cert --comment "We trust ACTools".

Source§

impl Extension<Install<InstallExt>>

Source

pub fn get_yes(&self) -> bool

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

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

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

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

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

pub fn get_allow_unsigned(&self) -> bool

§Description

–allow-unsigned

(Optional) If included in the commands to install (or delete) an extension, it is the same as if the server.extensions.allow.unsigned configurable were set to 1 so that the extension does not need to be signed.

Source

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

§Description

–allow-unsigned

(Optional) If included in the commands to install (or delete) an extension, it is the same as if the server.extensions.allow.unsigned configurable were set to 1 so that the extension does not need to be signed.

Source

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

§Description

–allow-unsigned

(Optional) If included in the commands to install (or delete) an extension, it is the same as if the server.extensions.allow.unsigned configurable were set to 1 so that the extension does not need to be signed.

Source§

impl Extension<Install<InstallCert>>

Source

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

§Description

–comment

Can be supplied in --install or --delete. For example, p4 extension --install path/certificate.txt --cert --comment "We trust ACTools".

Source

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

§Description

–comment

Can be supplied in --install or --delete. For example, p4 extension --install path/certificate.txt --cert --comment "We trust ACTools".

Source

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

§Description

–comment

Can be supplied in --install or --delete. For example, p4 extension --install path/certificate.txt --cert --comment "We trust ACTools".

Source§

impl Extension<Delete<Unselected>>

Source

pub fn get_fqn(&self) -> &str

Returns the fully-qualified name (or certificate fingerprint) to delete.

Source

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

Sets the fully-qualified name (or certificate fingerprint) to delete.

Source

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

Sets the fully-qualified name (or certificate fingerprint) to delete.

Source

pub fn yes(self) -> Extension<Delete<DeleteExt>>

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

pub fn name(self, v: impl Into<String>) -> Extension<Delete<DeleteExt>>

§Description

–name instName

To remove the named instance config, include the --name option.

Source

pub fn revision(self, v: impl Into<String>) -> Extension<Delete<DeleteExt>>

§Description

–revision=n

To remove one specific revision and its instances, include the --revision option.

Source

pub fn path(self, v: impl Into<String>) -> Extension<Delete<DeleteExt>>

§Description

–path FileSpec

To delete file-based instances registered under the specified path, use the --path option.

Source

pub fn cert(self) -> Extension<Delete<DeleteCert>>

§Description

–cert

Can be supplied in --install or --delete. For example, p4 extension --install path/certificate.txt --cert --comment "We trust ACTools".

Source§

impl Extension<Delete<DeleteExt>>

Source

pub fn get_yes(&self) -> bool

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

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

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

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

§Description

–yes

To actually perform the install or delete, the --yes option is required. Without --yes, the p4 extension command merely reports what it would do without actually performing the install or delete. -y is equivalent to --yes.

Source

pub fn get_name(&self) -> Option<&String>

§Description

–name instName

To remove the named instance config, include the --name option.

Source

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

§Description

–name instName

To remove the named instance config, include the --name option.

Source

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

§Description

–name instName

To remove the named instance config, include the --name option.

Source

pub fn get_revision(&self) -> Option<&String>

§Description

–revision=n

To remove one specific revision and its instances, include the --revision option.

Source

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

§Description

–revision=n

To remove one specific revision and its instances, include the --revision option.

Source

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

§Description

–revision=n

To remove one specific revision and its instances, include the --revision option.

Source

pub fn get_path(&self) -> Option<&String>

§Description

–path FileSpec

To delete file-based instances registered under the specified path, use the --path option.

Source

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

§Description

–path FileSpec

To delete file-based instances registered under the specified path, use the --path option.

Source

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

§Description

–path FileSpec

To delete file-based instances registered under the specified path, use the --path option.

Source

pub fn get_allow_unsigned(&self) -> bool

§Description

–allow-unsigned

(Optional) If included in the commands to install (or delete) an extension, it is the same as if the server.extensions.allow.unsigned configurable were set to 1 so that the extension does not need to be signed.

Source

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

§Description

–allow-unsigned

(Optional) If included in the commands to install (or delete) an extension, it is the same as if the server.extensions.allow.unsigned configurable were set to 1 so that the extension does not need to be signed.

Source

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

§Description

–allow-unsigned

(Optional) If included in the commands to install (or delete) an extension, it is the same as if the server.extensions.allow.unsigned configurable were set to 1 so that the extension does not need to be signed.

Source§

impl Extension<Configure<Unselected>>

Source

pub fn stdin(self) -> Extension<Configure<Stdin>>

§Description

-i

Read the extension definition from standard input.

Source

pub fn stdout(self) -> Extension<Configure<Stdout>>

§Description

-o

Write the extension definition from to standard output.

Source§

impl<M: ExclusiveOption> Extension<Configure<M>>

Source

pub fn get_fqn(&self) -> &str

Returns the fully-qualified name of the extension to configure.

Source

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

Sets the fully-qualified name of the extension to configure.

Source

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

Sets the fully-qualified name of the extension to configure.

Source

pub fn get_revision(&self) -> Option<&String>

§Description

–revision=n

Which depot version of the Extension to configure. The default is the head revision. This option applies to the --configure option. This flag applies to the --configure option when used with or without the --name option.

Source

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

§Description

–revision=n

Which depot version of the Extension to configure. The default is the head revision. This option applies to the --configure option. This flag applies to the --configure option when used with or without the --name option.

Source

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

§Description

–revision=n

Which depot version of the Extension to configure. The default is the head revision. This option applies to the --configure option. This flag applies to the --configure option when used with or without the --name option.

Source

pub fn get_name(&self) -> Option<&String>

§Description

–name instName

The name of the instance configuration to create, modify, or delete.

Source

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

§Description

–name instName

The name of the instance configuration to create, modify, or delete.

Source

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

§Description

–name instName

The name of the instance configuration to create, modify, or delete.

Source§

impl Extension<Run>

Source

pub fn get_inst(&self) -> &str

Returns the instance configuration whose extension is executed.

Source

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

Sets the instance configuration whose extension is executed.

Source

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

Sets the instance configuration whose extension is executed.

Source§

impl Extension<List>

Source

pub fn get_ty(&self) -> Option<Type>

§Description

–type type

Must be supplied with --list. Possible type values: extensions, global, instance, certs, configs (both global and instance). For example, p4 extension --list --type certs.

Source

pub fn set_ty(&mut self, v: Type) -> &mut Self

§Description

–type type

Must be supplied with --list. Possible type values: extensions, global, instance, certs, configs (both global and instance). For example, p4 extension --list --type certs.

Source

pub fn ty(self, v: Type) -> Self

§Description

–type type

Must be supplied with --list. Possible type values: extensions, global, instance, certs, configs (both global and instance). For example, p4 extension --list --type certs.

Source

pub fn get_path(&self) -> Option<&String>

§Description

–path FileSpec

Filters output to instance configurations that are path-based and whose path argument matches the given filespec.

Source

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

§Description

–path FileSpec

Filters output to instance configurations that are path-based and whose path argument matches the given filespec.

Source

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

§Description

–path FileSpec

Filters output to instance configurations that are path-based and whose path argument matches the given filespec.

Trait Implementations§

Source§

impl<T: ExclusiveOption> ParameterizedSpawn<()> for Extension<T>

Source§

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

Spawns the selected p4 extension operation 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<S, I> ParameterizedSpawn<(S,)> for Extension<Run>
where S: IntoIterator<Item = I>, I: AsRef<OsStr>,

Available on non-crate feature lt2020_1 only.
Source§

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

Spawns p4 extension --run instName with the given extra arguments passed through to the extension, 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<T: ExclusiveOption> SubCommand for Extension<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 Extension<T>
where T: Freeze,

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Extension<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> 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, 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.