Struct hn::HackerNews
[−]
[src]
pub struct HackerNews { /* fields omitted */ }
Main interface to the Hacker News API
Examples
extern crate hn; use std::time::Duration; use std::thread; fn main() { let hn = hn::HackerNews::new(); while hn.into_iter().count() == 0 { thread::sleep(Duration::from_millis(1000)); } for item in hn.into_iter() { println!("item: {}", item.title()); } }
Methods
impl HackerNews
[src]
pub fn new() -> HackerNews
[src]
Return a newly allocated HN wrapper, and spawn background thread
pub fn len(&self) -> usize
[src]
Return number of items currently in the 'top list'
pub fn hide(&self, item: &Item)
[src]
Hide an item so it isn't returned in future iterator passes
Trait Implementations
impl Clone for HackerNews
[src]
fn clone(&self) -> HackerNews
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for HackerNews
[src]
fn default() -> HackerNews
[src]
Returns the "default value" for a type. Read more
impl Deref for HackerNews
[src]
type Target = IHackerNews
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.