pub enum OperationKind {
Show 26 variants
Replace {
paragraph: Selector,
find: String,
replacement: String,
format: Option<RunFormat>,
comment: Option<String>,
whole: bool,
occurrence: Option<usize>,
},
Insert {
paragraph: Selector,
after: Option<String>,
before: Option<String>,
position: Option<Edge>,
text: String,
format: Option<RunFormat>,
comment: Option<String>,
occurrence: Option<usize>,
},
Delete {
paragraph: Selector,
find: String,
occurrence: Option<usize>,
comment: Option<String>,
},
Comment {
paragraph: Selector,
find: Option<String>,
text: String,
through: Option<Selector>,
occurrence: Option<usize>,
},
InsertParagraph {
paragraph: Selector,
position: Side,
runs: Vec<RunSpec>,
like: Option<Selector>,
style: Option<String>,
comment: Option<String>,
},
DeleteParagraph {
paragraph: Selector,
comment: Option<String>,
},
FormatParagraph {
paragraph: Selector,
style: Option<String>,
alignment: Option<Alignment>,
line_spacing: Option<LineSpacing>,
space_before: Option<Points>,
space_after: Option<Points>,
},
MergeParagraphs {
paragraph: Selector,
separator: Option<String>,
},
Rewrite {
paragraph: Selector,
text: String,
comment: Option<String>,
},
ReplyComment {
comment_id: u32,
text: String,
},
ResolveComment {
comment_id: u32,
done: bool,
},
EditComment {
comment_id: u32,
text: String,
},
DeleteComment {
comment_id: u32,
},
Strike {
revision: String,
comment: Option<String>,
},
Restore {
revision: String,
comment: Option<String>,
},
InsertTable {
paragraph: Selector,
position: Side,
rows: Vec<Vec<String>>,
header_row: bool,
widths_dxa: Option<Vec<u32>>,
style: Option<String>,
},
List {
paragraphs: Vec<Selector>,
kind_of_list: ListKind,
level: u32,
restart: bool,
},
Watermark {
text: String,
color: Option<String>,
diagonal: Option<bool>,
font: Option<String>,
},
FillControl {
control: ControlSelector,
text: Option<String>,
choice: Option<String>,
checked: Option<bool>,
date: Option<String>,
},
FormatRun {
paragraph: Selector,
find: String,
format: RunFormat,
occurrence: Option<usize>,
},
InsertFootnote {
paragraph: Selector,
after: String,
text: String,
occurrence: Option<usize>,
},
InsertImage {
paragraph: Selector,
position: Side,
image_base64: String,
content_type: Option<String>,
width_emu: Option<u64>,
alt: Option<String>,
},
PageSetup {
section: SectionScope,
page: Option<PageSize>,
orientation: Option<Orientation>,
margins_dxa: Margins,
},
InsertToc {
paragraph: Selector,
position: Side,
levels: u8,
title: Option<String>,
},
Redact {
paragraph: Selector,
find: String,
occurrence: Option<usize>,
},
Settings {
track_revisions: Option<bool>,
update_fields: Option<bool>,
protection: Option<Protection>,
},
}Expand description
The supported operation kinds (wire tag kind).
Variants§
Replace
Replace exactly one occurrence of find in the paragraph.
Fields
Insert
Insert text after/before exactly one occurrence of an anchor, or at
the paragraph’s start/end. Exactly one of after, before,
position must be given.
Fields
Delete
Delete exactly one occurrence of find.
Fields
Comment
Comment on exactly one occurrence of find, or on the whole paragraph.
The range may cross tabs, symbols, hyperlinks, fields, content
controls and revisions: a comment edits nothing.
Fields
InsertParagraph
Insert a new paragraph next to the anchor paragraph, copying its
paragraph properties (never its section break or revision marks), or
those of like.
Fields
DeleteParagraph
Delete a whole paragraph, mark included.
Fields
FormatParagraph
Change a paragraph’s style, alignment or spacing; the redline records
the old properties (w:pPrChange). At least one field besides
paragraph.
Fields
line_spacing: Option<LineSpacing>Line spacing as a multiple of single spacing (1.5, 2).
MergeParagraphs
Join the paragraph with the one right after it. The first’s text moves to the start of the second, whose paragraph properties (and section break) survive, as when Word accepts a deleted paragraph mark. The redline deletes the first paragraph’s mark.
Fields
Rewrite
Make the paragraph read as text: the engine applies the smallest
word-level edits, so unchanged words keep their runs and formatting,
and new words take the formatting of the run before them. A tab or a
line break the paragraph has may be written as a space and stays; a
\t or \n in text writes one. Symbols stay where they are and
may be left out of text.
Fields
ReplyComment
Reply to comment comment_id, as the plan’s author; the reply is
anchored on the same range. Word threads are one level deep, so a
reply to a reply joins the thread’s first comment.
Fields
ResolveComment
Resolve comment comment_id and its replies (done: false opens
them again).
Fields
EditComment
Replace the text of comment comment_id; its id, author, date and
thread stay.
Fields
DeleteComment
Remove comment comment_id, its replies, their range markers and
references.
Strike
Reject another author’s insertion visibly: our tracked deletion of
its words, nested inside it, so Word shows it struck under our name
and Reject of our change gives it back. Needs existing_revisions
keep.
Fields
Restore
Reject another author’s deletion visibly: their deletion stays, and
our tracked insertion right after it holds a copy of its words,
formatting included. Needs existing_revisions keep.
Fields
InsertTable
Insert a table next to the anchor paragraph. Each cell holds one paragraph in the anchor’s paragraph style; the redline shows the rows inserted. Body paragraphs outside tables only.
Fields
List
Make the paragraphs a list: each gets direct numbering at level,
and ListParagraph when it has no style. The redline records each
paragraph’s old properties (w:pPrChange).
Fields
Watermark
Write Word’s own text watermark (Insert > Watermark) into every default header, creating a header where the first section has none. One per document. It is header content, not a tracked change: the clean copy and the redline both carry it.
Fields
FillControl
Fill one content control (w:sdt) in the body with exactly one of
text, choice, checked or date. The control keeps its
properties; its content becomes the value.
Fields
control: ControlSelectorThe control: "p3.cc0" / "cc1", {"id"}, {"tag"} or {"alias"};
must match exactly one.
FormatRun
Change the run formatting of one occurrence of existing text; the
redline records the old formatting (w:rPrChange).
Fields
InsertFootnote
Insert a footnote whose reference mark follows one occurrence of
after; the note goes in the footnotes part, created when absent.
Fields
InsertImage
Insert a paragraph holding one inline picture next to the anchor paragraph. PNG, JPEG, GIF, BMP or TIFF.
Fields
PageSetup
Set the page size, orientation and margins of the last section or of
every section; the redline records the old ones (w:sectPrChange).
At least one of page, orientation, margins_dxa.
Fields
section: SectionScopelast (default) or all.
orientation: Option<Orientation>portrait or landscape.
InsertToc
Insert a table of contents next to the anchor paragraph: a TOC \o "1-{levels}" \h \z \u field, after an optional title paragraph
styled TOCHeading. Its entries are written when the plan sets
update_fields; otherwise the field is empty until Word updates it.
Fields
Redact
Replace one occurrence of find with one full block
(U+2588) per character, untracked: the clean copy and the redline
both show the blocks and neither keeps the text. The plan is refused
with REDACTION_LEAK when the text still occurs anywhere in either
output, and with REDACTION_INCOMPLETE when a part uses an encoding
the scan does not certify. The report never repeats the text.
Fields
Settings
Write document settings into word/settings.xml in schema order:
Track Changes, update fields on open, editing restrictions. Settings
are not revisions: the clean copy and the redline both carry them.
One per plan; a setting left out stays as it is.
Trait Implementations§
Source§impl Clone for OperationKind
impl Clone for OperationKind
Source§fn clone(&self) -> OperationKind
fn clone(&self) -> OperationKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OperationKind
impl Debug for OperationKind
Source§impl<'de> Deserialize<'de> for OperationKind
impl<'de> Deserialize<'de> for OperationKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OperationKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OperationKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for OperationKind
Source§impl JsonSchema for OperationKind
impl JsonSchema for OperationKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for OperationKind
impl PartialEq for OperationKind
Source§impl Serialize for OperationKind
impl Serialize for OperationKind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for OperationKind
Auto Trait Implementations§
impl Forget for OperationKind
impl Freeze for OperationKind
impl Move for OperationKind
impl RefUnwindSafe for OperationKind
impl Send for OperationKind
impl Sync for OperationKind
impl Unpin for OperationKind
impl UnsafeUnpin for OperationKind
impl UnwindSafe for OperationKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.