[][src]Struct mediawiki::page::Page

pub struct Page { /* fields omitted */ }

Represents a page.

Implementations

impl Page[src]

pub fn new(title: Title) -> Self[src]

Creates a new Page from a Title.

pub fn title(&self) -> &Title[src]

Accesses the Title of this Page.

pub async fn text(&self, api: &Api) -> Result<String, PageError>[src]

Fetches the current text of this Page. If there is one slot in the current revision, it is fetched; if there are multiple slots, the "main" slot is fetched, or an error is returned if there is no "main" slot.

Errors

If the page is missing, will return a PageError::Missing.

pub async fn edit_text(
    &self,
    api: &mut Api,
    text: impl Into<String>,
    summary: impl Into<String>
) -> Result<(), Box<dyn Error>>
[src]

Replaces the contents of this Page with the given text, using the given edit summary.

Errors

May return a PageError or any error from Api::post_query_api_json.

pub async fn categories(&self, api: &Api) -> Result<Vec<Value>, Box<dyn Error>>[src]

Returns the categories of a page, as a JSON Value Vec

Returns the categories of a page, as a JSON Value Vec

pub async fn templates(&self, api: &Api) -> Result<Vec<Title>, Box<dyn Error>>[src]

Returns the templates of a page, as a Title Vec

Returns the wiki-internal links on a page, as a Title Vec

Returns the wiki-internal links on a page, as a Title Vec

pub async fn images(&self, api: &Api) -> Result<Vec<Title>, Box<dyn Error>>[src]

Returns the images used on a page, as a Title Vec

pub async fn coordinates(&self, api: &Api) -> Result<Vec<Value>, Box<dyn Error>>[src]

Returns the coordinates of a page, as a JSON Value Vec

pub async fn coordinates_distance(
    &self,
    api: &Api,
    lat: f64,
    lon: f64
) -> Result<Vec<Value>, Box<dyn Error>>
[src]

Returns the coordinates of a page, including distance from a point, as a JSON Value Vec

Returns the external links of a page, as a String Vec

Trait Implementations

impl Clone for Page[src]

impl Debug for Page[src]

impl Eq for Page[src]

impl PartialEq<Page> for Page[src]

impl StructuralEq for Page[src]

impl StructuralPartialEq for Page[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.