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>
impl Export<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 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.
Sourcepub fn checkpoint(
self,
token: impl Into<String>,
) -> Export<CheckPoint<Unselected>>
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.
Sourcepub fn format_non_text(self) -> Export<Format>
pub fn format_non_text(self) -> Export<Format>
Sourcepub fn raw_journal(self) -> Export<RawJournal>
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>
impl Export<Format>
Sourcepub fn get_format_non_text(&self) -> bool
pub fn get_format_non_text(&self) -> bool
Sourcepub fn set_format_non_text(&mut self, v: bool) -> &mut Self
pub fn set_format_non_text(&mut self, v: bool) -> &mut Self
Sourcepub fn format_non_text(self, v: bool) -> Self
pub fn format_non_text(self, v: bool) -> Self
Sourcepub fn checkpoint(self, token: impl Into<String>) -> Export<CheckPoint<Format>>
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§impl Export<RawJournal>
impl Export<RawJournal>
Source§impl<M> Export<M>
impl<M> Export<M>
Sourcepub fn get_prefix(&self) -> Option<&str>
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.
Sourcepub fn set_prefix(&mut self, v: impl Into<String>) -> &mut Self
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.
Sourcepub fn prefix(self, v: impl Into<String>) -> Self
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.
Sourcepub fn get_filter(&self) -> Option<&str>
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".
Sourcepub fn set_filter(&mut self, v: impl Into<String>) -> &mut Self
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".
Sourcepub fn filter(self, v: impl Into<String>) -> Self
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".
Sourcepub fn get_excluded_tables(&self) -> Option<&[String]>
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".
Sourcepub fn set_excluded_tables(&mut self, v: Vec<String>) -> &mut Self
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".
Sourcepub fn excluded_tables(self, v: Vec<String>) -> Self
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".
Sourcepub fn get_filter_patterns(&self) -> Option<&[String]>
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 excludeThe 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.
Sourcepub fn set_filter_pattern(&mut self, v: impl Into<String>) -> &mut Self
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.
Sourcepub fn filter_pattern(self, v: impl Into<String>) -> Self
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.