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]

[src]

Return a newly allocated HN wrapper, and spawn background thread

[src]

Return number of items currently in the 'top list'

[src]

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

Trait Implementations

impl Clone for HackerNews
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for HackerNews
[src]

[src]

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

impl Deref for HackerNews
[src]

The resulting type after dereferencing.

[src]

Dereferences the 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?

[src]

Creates an iterator from a value. Read more

Auto Trait Implementations

impl Send for HackerNews

impl Sync for HackerNews