[−][src]Struct github_stats::search::Search
Uses Github's search API.
Example
Get merged PRs
use github_stats::{Query, Search}; let query = Query::new() .repo("rust-lang", "rust") .is("pr") .is("merged"); let results = Search::issues(&query) .per_page(10) .page(1) .search("<my user agent>") .await; match results { Ok(results) => { /* do stuff */ } Err(e) => eprintln!(":("), }
Implementations
impl Search
[src]
pub fn issues(query: &Query) -> Self
[src]
pub fn users(query: &Query) -> Self
[src]
pub fn authorization(self, token: &str) -> Self
[src]
Sets an authorization token for querying the API
pub fn get_query(&self) -> &str
[src]
Gets the query that will be used for the search.
pub fn per_page(self, per_page: usize) -> Self
[src]
Defaults to 10.
pub fn page(self, page: usize) -> Self
[src]
Defaults to 1.
pub fn next_page(&mut self)
[src]
Moves one page forward.
pub fn prev_page(&mut self)
[src]
Moves one page backward.
pub async fn search(&self, user_agent: &str) -> Result<SearchResults>
[src]
Runs the search.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Search
[src]
impl Send for Search
[src]
impl Sync for Search
[src]
impl Unpin for Search
[src]
impl UnwindSafe for Search
[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<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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,