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]

Return a newly allocated HN wrapper, and spawn background thread

Return number of items currently in the 'top list'

Hide an item so it isn't returned in future iterator passes

Trait Implementations

impl Clone for HackerNews
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for HackerNews
[src]

Returns the "default value" for a type. Read more

impl Deref for HackerNews
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a> IntoIterator for &'a HackerNews
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more