[−][src]Struct mediawiki::page::Page
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]
&self,
api: &mut Api,
text: impl Into<String>,
summary: impl Into<String>
) -> Result<(), Box<dyn Error>>
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
pub async fn interwiki_links(
&self,
api: &Api
) -> Result<Vec<Value>, Box<dyn Error>>
[src]
&self,
api: &Api
) -> Result<Vec<Value>, Box<dyn Error>>
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
pub async fn links(&self, api: &Api) -> Result<Vec<Title>, Box<dyn Error>>
[src]
Returns the wiki-internal links on a page, as a Title Vec
pub async fn links_here(
&self,
api: &Api,
direct_links: bool,
redirects: bool
) -> Result<Vec<Title>, Box<dyn Error>>
[src]
&self,
api: &Api,
direct_links: bool,
redirects: bool
) -> Result<Vec<Title>, Box<dyn Error>>
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]
&self,
api: &Api,
lat: f64,
lon: f64
) -> Result<Vec<Value>, Box<dyn Error>>
Returns the coordinates of a page, including distance from a point, as a JSON Value Vec
pub async fn external_links(
&self,
api: &Api
) -> Result<Vec<String>, Box<dyn Error>>
[src]
&self,
api: &Api
) -> Result<Vec<String>, Box<dyn Error>>
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
impl RefUnwindSafe for Page
[src]
impl Send for Page
[src]
impl Sync for Page
[src]
impl Unpin for Page
[src]
impl UnwindSafe for Page
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,