pub struct Page { /* private fields */ }
Expand description

A Page represents a wiki page on a specific wiki (Bot). You can get metadata about a page, its contents (in HTML or wikitext) and edit the page.

Pages are obtained by calling bot.page("<title>")?. Each page is Sync and designed to easily Cloned so it can be sent across multiple threads for concurrent processing.

Most metadata lookups are internally batched and cached so it might not reflect the live state on the wiki if someone has edited or modified the page in the meantime. To get fresh information create a new Page instance.

Saving a page will respect {{nobots}} (if not disabled), wait as needed for the configured rate limit and automatically implement edit conflict detection.

Implementations

Get the title of the page

Get a reference to the underlying mwtitle::Title

Get the namespace ID of the page

Whether this page refers to a file

Whether this page refers to a category

Whether the page exists or not

Get the canonical URL for this page

Whether the page is a redirect or not

The associated page for this page (subject page for a talk page or talk page for a subject page)

If this page is a redirect, get the Page it targets

Get Parsoid HTML for self.baserevid if it’s set, or the latest revision otherwise

Get Parsoid HTML for the specified revision

Get wikitext for self.baserevid if it’s set, or the latest revision otherwise

Save the page using the specified HTML

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more