Skip to main content

Export

Struct Export 

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

Type-safe builder for p4 export.

§Syntax

p4 [g-opts] export -c token [-J prefix] [-f] [-l lines] [-F filter]
[-T tableexcludelist] [-P filterpattern]

p4 [g-opts] export -j token [-J prefix] [-f] [-l lines] [-F filter]
[-T tableexcludelist] [-P filterpattern]

p4 [g-opts] export -j token [-J prefix] -r [-F filter]
[-T tableexcludelist] [-P filterpattern]

Extract journal or checkpoint records.

This command reports checkpoint and journal metadata from a P4 Server server. With no options, the records are reported in tagged form.

Some fields are added to the tagged output to indicate either transactional consistency, or to indicate the end of the journal.

To filter database tables out of the exported data, use the -T option with a list of tables whose data you wish to exclude. To exclude data from multiple tables, separate the table names by spaces or commas. The table names must begin with “db.”, following the naming convention used for database files in the server root directory. If you separate the table exclusion list with spaces, you must enclose the list in quotes.

§Usage notes

Can File Arguments Use Revision Specifier? N/A

Can File Arguments Use Revision Range? N/A

Minimal Access Level Required: super available to an service user

Compressed journals or checkpoints are not supported.

The M type parameter tracks the option state at compile time. Unselected selects neither -c nor -j; format_non_text (-f) and limit (-l) enter the Format state, and raw_journal (-r) enters the RawJournal state. Only checkpoint (-c) and journal (-j) enter the CheckPoint and Journal states, which are the only states implementing ParameterizedSpawn, so a partially configured command cannot be spawned.

Implementations§

Source§

impl Export<Unselected>

Source

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

Creates a new p4 export command.

bin is the path to the Perforce command-line executable. The resulting command has neither -c nor -j selected and cannot be spawned until a checkpoint or journal is selected.

Source

pub fn checkpoint( self, token: impl Into<String>, ) -> Export<CheckPoint<Unselected>>

§Description

-c token

Specifies a checkpoint number or position token of the form checkpointnum#byteoffset.

Transitions this command to the CheckPoint state, which spawns.

Source

pub fn journal(self, token: impl Into<String>) -> Export<Journal<Unselected>>

§Description

-j token

Specify a journal number or position token of the form journalnum/byteoffset.

Transitions this command to the Journal state, which spawns.

Source

pub fn format_non_text(self) -> Export<Format>

§Description

-f

Format the output so that non-textual datatypes are formatted appropriately.

Transitions this command to the Format state; a checkpoint or journal must still be selected before spawning.

Source

pub fn limit(self, lines: u64) -> Export<Format>

§Description

-l lines

Limit output to the specified number of lines of journal records.

Transitions this command to the Format state; a checkpoint or journal must still be selected before spawning.

Source

pub fn raw_journal(self) -> Export<RawJournal>

§Description

-r

Display raw journal output; this argument applies to journals only.

Transitions this command to the RawJournal state; a journal must still be selected with journal (-j) before spawning.

Source§

impl Export<Format>

Source

pub fn get_format_non_text(&self) -> bool

§Description

-f

Format the output so that non-textual datatypes are formatted appropriately.

Source

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

§Description

-f

Format the output so that non-textual datatypes are formatted appropriately.

Source

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

§Description

-f

Format the output so that non-textual datatypes are formatted appropriately.

Source

pub fn get_limit(&self) -> Option<u64>

§Description

-l lines

Limit output to the specified number of lines of journal records.

Source

pub fn set_limit(&mut self, v: Option<u64>) -> &mut Self

§Description

-l lines

Limit output to the specified number of lines of journal records.

Source

pub fn limit(self, v: u64) -> Self

§Description

-l lines

Limit output to the specified number of lines of journal records.

Source

pub fn checkpoint(self, token: impl Into<String>) -> Export<CheckPoint<Format>>

§Description

-c token

Specifies a checkpoint number or position token of the form checkpointnum#byteoffset.

Transitions this command to the CheckPoint state, which spawns.

Source

pub fn journal(self, token: impl Into<String>) -> Export<Journal<Format>>

§Description

-j token

Specify a journal number or position token of the form journalnum/byteoffset.

Transitions this command to the Journal state, which spawns.

Source§

impl Export<RawJournal>

Source

pub fn journal(self, token: impl Into<String>) -> Export<Journal<RawJournal>>

§Description

-j token

Specify a journal number or position token of the form journalnum/byteoffset.

Transitions this command to the Journal state, which spawns.

Source§

impl<M> Export<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_prefix(&self) -> Option<&str>

§Description

-J prefix

Specifies a filename prefix for the journal, such as that used with p4d -jc prefix.

Source

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

§Description

-J prefix

Specifies a filename prefix for the journal, such as that used with p4d -jc prefix.

Source

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

§Description

-J prefix

Specifies a filename prefix for the journal, such as that used with p4d -jc prefix.

Source

pub fn get_filter(&self) -> Option<&str>

§Description

-F filter

Limit output to records that match the specified filter pattern. For example, -F "table = db.configure".

Source

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

§Description

-F filter

Limit output to records that match the specified filter pattern. For example, -F "table = db.configure".

Source

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

§Description

-F filter

Limit output to records that match the specified filter pattern. For example, -F "table = db.configure".

Source

pub fn get_excluded_tables(&self) -> Option<&[String]>

§Description

-T tableexcludelist

Supply a list of database tables (for example, db.have and db.client) to exclude from export. Limit output to records that match the specified filter pattern. For example, -T db.have,db.client or -T "db.have db.client".

Source

pub fn set_excluded_tables(&mut self, v: Vec<String>) -> &mut Self

§Description

-T tableexcludelist

Supply a list of database tables (for example, db.have and db.client) to exclude from export. Limit output to records that match the specified filter pattern. For example, -T db.have,db.client or -T "db.have db.client".

Source

pub fn excluded_tables(self, v: Vec<String>) -> Self

§Description

-T tableexcludelist

Supply a list of database tables (for example, db.have and db.client) to exclude from export. Limit output to records that match the specified filter pattern. For example, -T db.have,db.client or -T "db.have db.client".

Source

pub fn get_filter_patterns(&self) -> Option<&[String]>

§Description

-P filterpattern

Limit output to records that match the specified filter pattern. Multiple filter patterns can be specified with multiple -P options.

Each filterpattern begins with two characters and a colon, and specifies either a client filter or a depot filter, as well as whether the pattern is to be included or excluded, using the syntax:

-Pic://client/pattern - client records to include
-Pxc://client/pattern - client records to exclude
-Pif://depot/pattern - depot records to include
-Pxf://depot/pattern - depot records to exclude

The first character specifies whether the records are included or excluded (i or x), the second character specifies whether the records are client workspace-related or depot-file related (c or f), the colon is a separator, and the remainder of the filterpattern denotes either a client workspace view or a depot file path. The mechanism by which this filtering is implemented is the same as that which is used by the ClientDataFilter: and RevisionDataFilter fields in the p4 server form.

Source

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

§Description

-P filterpattern

Limit output to records that match the specified filter pattern. This option can be specified more than once; each call appends another pattern.

See get_filter_patterns for the pattern syntax.

Source

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

§Description

-P filterpattern

Limit output to records that match the specified filter pattern. This option can be specified more than once; each call appends another pattern.

See get_filter_patterns for the pattern syntax.

Source§

impl<M> Export<CheckPoint<M>>

Source

pub fn get_token(&self) -> &str

Get the checkpoint number or position token.

Source

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

Set the checkpoint number or position token.

Source

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

Set the checkpoint number or position token.

Source§

impl<M> Export<Journal<M>>

Source

pub fn get_token(&self) -> &str

Get the journal number or position token.

Source

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

Set the journal number or position token.

Source

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

Set the journal number or position token.

Source§

impl<M: ExclusiveOption> Export<M>

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 Export<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 Export<M>

Source§

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

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

impl<M: Default> Default for Export<M>

Source§

fn default() -> Self

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

impl<M: ExclusiveOption> ParameterizedSpawn<()> for Export<CheckPoint<M>>

Source§

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

Spawns p4 export -c token 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<M: ExclusiveOption> ParameterizedSpawn<()> for Export<Journal<M>>

Source§

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

Spawns p4 export -j token 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<M: ExclusiveOption> SubCommand for Export<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 Export<M>
where M: Freeze,

§

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

§

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

§

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

§

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

§

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

§

impl<M> UnwindSafe for Export<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, 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> 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.