pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
pub fn new() -> Self
pub fn submit( &self, title: String, url: Option<String>, text: Option<String>, ) -> Result<(), Box<dyn Error>>
pub fn login( &self, username: &str, password: &str, ) -> Result<(), Box<dyn Error>>
pub fn item(&self, id: Id) -> Result<Listing, Box<dyn Error>>
pub fn thread(&self, id: Id) -> Result<Thread, Box<dyn Error>>
pub fn news(&self) -> Result<Vec<Listing>, Box<dyn Error>>
pub fn past(&self, date: Date) -> Result<Vec<Listing>, Box<dyn Error>>
Sourcepub fn listings(&self, url: &str) -> Result<Vec<Listing>, Box<dyn Error>>
pub fn listings(&self, url: &str) -> Result<Vec<Listing>, Box<dyn Error>>
Retrieve a page of HackerNews Listings, such as that delivered from:
https://news.ycombinator.com/
https://news.ycombinator.com/newest
https://news.ycombinator.com/front
https://news.ycombinator.com/newcomments
https://news.ycombinator.com/ask
https://news.ycombinator.com/show
https://news.ycombinator.com/jobs
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more