pub struct WikiResource<'a> { /* private fields */ }Expand description
client.wiki()
Implementations§
Source§impl<'a> WikiResource<'a>
impl<'a> WikiResource<'a>
pub fn categories(&self) -> WikiCategoriesResource<'a>
Sourcepub fn list_pages(&self) -> Result<Vec<SimpleWikiPage>>
pub fn list_pages(&self) -> Result<Vec<SimpleWikiPage>>
List wiki pages
GET /wiki/pages
Lists the latest revisions of non-system, non-redirect pages in viewable categories. Guest category permissions are supported. Omitted/empty wiki_category_ids selects every viewable category; inaccessible IDs are silently dropped. Without query, ordering defaults to display title, then GUID. With query, default ranking prefers matching category main pages, then title matches, exact-content matches and finally matches containing all query words. Explicit order_fields overrides ranking. Pagination is applied after finding and enriching all matching pages. Text is omitted unless include[]=text; include[]=preview returns an unrendered stored-text prefix, which may contain raw HTML. searchPreview is independently included when query is supplied. meta contains page count and pagination total/limit/current/lastPage; lastPage is 0 for no results.
Use Self::list_pages_with to pass query parameters.
§Example
for page in client.wiki().list_pages()? {
println!("{}", page.title);
}Sourcepub fn list_pages_with(
&self,
query: &GetWikiPagesQuery,
) -> Result<Vec<SimpleWikiPage>>
pub fn list_pages_with( &self, query: &GetWikiPagesQuery, ) -> Result<Vec<SimpleWikiPage>>
List wiki pages
Like Self::list_pages, with query parameters.
GET /wiki/pages
Lists the latest revisions of non-system, non-redirect pages in viewable categories. Guest category permissions are supported. Omitted/empty wiki_category_ids selects every viewable category; inaccessible IDs are silently dropped. Without query, ordering defaults to display title, then GUID. With query, default ranking prefers matching category main pages, then title matches, exact-content matches and finally matches containing all query words. Explicit order_fields overrides ranking. Pagination is applied after finding and enriching all matching pages. Text is omitted unless include[]=text; include[]=preview returns an unrendered stored-text prefix, which may contain raw HTML. searchPreview is independently included when query is supplied. meta contains page count and pagination total/limit/current/lastPage; lastPage is 0 for no results.
Sourcepub fn list_pages_iter(
&self,
query: &GetWikiPagesQuery,
) -> Items<SimpleWikiPage> ⓘ
pub fn list_pages_iter( &self, query: &GetWikiPagesQuery, ) -> Items<SimpleWikiPage> ⓘ
List wiki pages
Like Self::list_pages_with, but lazy: each page is fetched only when the iteration reaches it.
Breaking off early saves the remaining requests.
Sourcepub fn list_search(
&self,
query: &GetWikiSearchQuery,
) -> Result<Vec<WikiSearchResult>>
pub fn list_search( &self, query: &GetWikiSearchQuery, ) -> Result<Vec<WikiSearchResult>>
Full-text search across wiki pages
GET /wiki/search
Searches latest non-system, non-redirect pages in categories the current user or guest can view. Omitted/empty wiki_category_ids means all viewable categories; inaccessible categories are silently dropped. Results are grouped by relevance: category-name main pages, title matches (shorter first), exact text matches and then matches containing all query words. Results are deduplicated by GUID and are not paginated. The query is not trimmed; SQL LIKE wildcard characters % and _ are interpreted. Results contain domain-object links and a text preview with Markdown emphasis for matches, not the full page. For paginated page resources, use GET /wiki/pages.
§Example
let query = GetWikiSearchQuery {
query: Some("welcome".into()),
..Default::default()
};
for search in client.wiki().list_search(&query)? {
println!("{}", search.title);
}