Skip to main content

NamedEdit

Enum NamedEdit 

Source
#[non_exhaustive]
pub enum NamedEdit { Replace { at: Address, find: String, with: String, }, Insert { at: Address, place: Place, text: String, style: Option<String>, }, Delete { at: Address, }, Style { at: Address, style: String, }, SetText { at: Address, text: String, }, InsertRow { at: Address, place: Place, cells: Vec<String>, }, Comment { at: Address, text: String, find: Option<String>, author: String, }, InsertImage { at: Address, place: Place, image: ImageFile, alt: String, size: (Option<Length>, Option<Length>), }, }
Expand description

One named edit of an edit list.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Replace

Replaces the text find, which must occur once in the paragraph’s text, with with. The match may cross runs, but not a tab, a break, a field code, an object or the edge of a hyperlink, a content control, a smart tag, a simple field or custom XML. The new text takes the formatting of the first run of the match.

Fields

§at: Address

The paragraph.

§find: String

The text to find.

§with: String

The new text, without control characters.

§

Insert

Inserts a new paragraph with text before or after the paragraph or the table at. After a paragraph it takes the paragraph’s properties without its section break, and the style that the paragraph’s style names as the next one, as Word’s Enter does; the text keeps the formatting of the paragraph’s first run while the style stays the same. Before or after a table it gets no properties. style, an ID or a name of a paragraph style, wins.

Fields

§at: Address

The paragraph or the table.

§place: Place

Before or after it.

§text: String

The text, in which a tab (\t) becomes a tab and no other control character may stand.

§style: Option<String>

The paragraph style, by its ID or its name.

§

Delete

Deletes the paragraph, the table or the row at.

Fields

§at: Address

The block or the row.

§

Style

Sets the style of the paragraph or the table at, by the style’s ID or its name.

Fields

§at: Address

The paragraph or the table.

§style: String

The style.

§

SetText

Sets all the text of the paragraph or the cell at to text. A paragraph keeps its properties and gets one run in the formatting of its first run. A cell keeps its properties and gets one paragraph with the properties of its first paragraph and one run in the formatting of that paragraph’s first run. An empty text gets no run.

Fields

§at: Address

The paragraph or the cell.

§text: String

The text, in which a tab (\t) becomes a tab and no other control character may stand.

§

InsertRow

Inserts a new row before or after the row at. It takes the row’s properties, and each new cell the properties of its cell and one paragraph with the properties of that cell’s first paragraph. A new cell continues a vertical merge that goes on past the new row, and else takes part in none.

Fields

§at: Address

The row.

§place: Place

Before or after it.

§cells: Vec<String>

The texts of the first cells, at most one for each cell, each in the formatting of the first run of its cell’s first paragraph; the other cells stay empty.

§

Comment

Adds a comment by author with text to the paragraph at: around its content, or around the one match of find, which follows the rules of a replace.

Fields

§at: Address

The paragraph.

§text: String

The comment’s text, in which a tab becomes a tab and no other control character may stand.

§find: Option<String>

The text of the paragraph that the comment marks, or none for all of it.

§author: String

The comment’s author, not empty.

§

InsertImage

Inserts a new paragraph with one inline picture before or after the paragraph or the table at, with the properties and the style that an insert gives it.

Fields

§at: Address

The paragraph or the table.

§place: Place

Before or after it.

§image: ImageFile

The image.

§alt: String

The text that describes the image, not empty.

§size: (Option<Length>, Option<Length>)

The width and the height of the drawing: both as given; one as given, with the other in the image’s aspect; or neither, for the image’s own size, made smaller in its aspect to the width of the first text column of the block’s section when it is wider.

Implementations§

Source§

impl NamedEdit

Source

pub const fn at(&self) -> &Address

The address that the edit names.

Trait Implementations§

Source§

impl Clone for NamedEdit

Source§

fn clone(&self) -> NamedEdit

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 Debug for NamedEdit

Source§

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

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

impl Eq for NamedEdit

Source§

impl PartialEq for NamedEdit

Source§

fn eq(&self, other: &NamedEdit) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NamedEdit

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

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.