pub fn probe(&mut self) -> Result<(), Error> {
        debug!("Probing feed `{}' to determine type", self.url);

        let body = self.request_feed()?;
        let feed = self.parse_feed(&body);

        let database = self.database.as_ref().expect("database not initialized");

        // Save the feed in the database.
        match feed {
            Ok(Feed::Rss(_)) => {
                database.try_create_feed(self.url.as_str(), 1 /* 1 = RSS */)?;
            }
            Ok(Feed::Atom(_)) => {
                database.try_create_feed(self.url.as_str(), 2 /* 2 = Atom */)?;
            }
            Err(_) => {}
        }

        Ok(())
    }
/// Requests the feed url and tries to determine whether it's an RSS or an Atom feed.
Requests the feed url and tries to determine whether it's an RSS or an Atom feed.
Requests the feed url and tries to determine whether it ' s an RSS or an Atom feed .
pub fn probe(&mut self) -> Result<(), Error> {
        debug!("Probing feed `{}' to determine type", self.url);
        let body = self.request_feed()?;
        let feed = self.parse_feed(&body);
        let database = self.database.as_ref().expect("database not initialized");
        // Save the feed in the database.
        match feed {
            Ok(Feed::Rss(_)) => {
                database.try_create_feed(self.url.as_str(), 1 /* 1 = RSS */)?;
            }
            Ok(Feed::Atom(_)) => {
                database.try_create_feed(self.url.as_str(), 2 /* 2 = Atom */)?;
            }
            Err(_) => {}
        }
        Ok(())
    }
pub fn probe ( & mut self ) -> Result < ( ) , Error > { debug ! ( " " self url ) ; let body = self . request_feed ( ) ? ; let feed = self . parse_feed ( & body ) ; let database = self . database . as_ref ( ) . expect ( " " ) ; // Save the feed in the database. match feed { Ok ( Feed :: Rss ( _ ) ) => { database . try_create_feed ( self . url . as_str ( ) , 1 /* 1 = RSS */ ) ? ; } Ok ( Feed :: Atom ( _ ) ) => { database . try_create_feed ( self . url . as_str ( ) , 2 /* 2 = Atom */ ) ? ; } Err ( _ ) => { } } Ok ( ( ) ) }
Requests the feed url and tries to determine whether it's an RSS or an Atom feed.
Requests the feed url and tries to determine whether it ' s an RSS or an Atom feed .
&mut self