pub struct Page<'a, A: 'a + HttpClient> { /* private fields */ }
Implementations§
source§impl<'a, A: HttpClient> Page<'a, A>
impl<'a, A: HttpClient> Page<'a, A>
A wikipedia article.
sourcepub fn from_title(wikipedia: &'a Wikipedia<A>, title: String) -> Page<'_, A>
pub fn from_title(wikipedia: &'a Wikipedia<A>, title: String) -> Page<'_, A>
Creates a new Page
given a title
.
sourcepub fn from_pageid(wikipedia: &'a Wikipedia<A>, pageid: String) -> Page<'_, A>
pub fn from_pageid(wikipedia: &'a Wikipedia<A>, pageid: String) -> Page<'_, A>
Creates a new Page
given a pageid
.
sourcepub fn get_pageid(&self) -> Result<String>
pub fn get_pageid(&self) -> Result<String>
Gets the Page
’s pageid
.
sourcepub fn get_content(&self) -> Result<String>
pub fn get_content(&self) -> Result<String>
Gets the markdown content of the article.
sourcepub fn get_html_content(&self) -> Result<String>
pub fn get_html_content(&self) -> Result<String>
Gets the html content of the article.
sourcepub fn get_summary(&self) -> Result<String>
pub fn get_summary(&self) -> Result<String>
Gets a summary of the article.
sourcepub fn get_images(&self) -> Result<Iter<'_, A, Image>>
pub fn get_images(&self) -> Result<Iter<'_, A, Image>>
Creates an iterator to view all images in the Page
.
sourcepub fn get_references(&self) -> Result<Iter<'_, A, Reference>>
pub fn get_references(&self) -> Result<Iter<'_, A, Reference>>
Creates an iterator to view all references (external links) in the Page
.
sourcepub fn get_links(&self) -> Result<Iter<'_, A, Link>>
pub fn get_links(&self) -> Result<Iter<'_, A, Link>>
Creates an iterator to view all internal links in the Page
.
sourcepub fn get_categories(&self) -> Result<Iter<'_, A, Category>>
pub fn get_categories(&self) -> Result<Iter<'_, A, Category>>
Creates an iterator to view all categories of the Page
.
sourcepub fn get_langlinks(&self) -> Result<Iter<'_, A, LangLink>>
pub fn get_langlinks(&self) -> Result<Iter<'_, A, LangLink>>
Creates an iterator to view all langlinks of the Page
.
This iterates over the page titles in all available languages.
sourcepub fn get_coordinates(&self) -> Result<Option<(f64, f64)>>
pub fn get_coordinates(&self) -> Result<Option<(f64, f64)>>
Returns the latitude and longitude associated to the Page
if any.
sourcepub fn get_sections(&self) -> Result<Vec<String>>
pub fn get_sections(&self) -> Result<Vec<String>>
Fetches all sections of the article.
Trait Implementations§
Auto Trait Implementations§
impl<'a, A> RefUnwindSafe for Page<'a, A>where A: RefUnwindSafe,
impl<'a, A> Send for Page<'a, A>where A: Sync,
impl<'a, A> Sync for Page<'a, A>where A: Sync,
impl<'a, A> Unpin for Page<'a, A>
impl<'a, A> UnwindSafe for Page<'a, A>where A: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more