Struct FeedlyApi

Source
pub struct FeedlyApi { /* private fields */ }

Implementations§

Source§

impl FeedlyApi

Source

pub fn new( client_id: String, client_secret: String, access_token: AccessToken, refresh_token: RefreshToken, token_expires: DateTime<Utc>, ) -> Result<FeedlyApi, ApiError>

Create a new FeedlyApi instance

  • client_id: identifies the client making requests to feedly
  • client_secret: issued by feedly staff together with client_id
  • access_token: access token received after sucessfull oauth process
  • refresh_token: received together with access_token, used to refresh it when expired
  • token_expires: point in time when access_token expires and has to refreshed
Source

pub fn login_url(client_id: &str, client_secret: &str) -> Result<Url, ApiError>

Generate OAuth login URL.

Source

pub fn parse_redirected_url(url: &Url) -> Result<AuthCode, ApiError>

Parse the redirected URL after login via OAuth. Returns the AuthCode needed to continue with the login process.

Source

pub fn redirect_uri() -> Result<Url, ApiError>

Base URL of the desired redirect URL. Will contain the AuthCode and can be fed into parse_redirected_url.

Source

pub async fn initialize_user_id(&self, client: &Client) -> Result<(), ApiError>

Will fetch the user id from feedly if not already done so.

Source

pub fn parse_expiration_date( expires_in: &str, ) -> Result<DateTime<Utc>, ApiError>

Parse expiration date of access_token to rust NaiveDateTime.

Source

pub fn gernerate_feed_id(url: &Url) -> String

Generate a feedly feed id from a feed URL (not a website URL).

Source

pub async fn generate_category_id( &self, title: &str, client: &Client, ) -> Result<String, ApiError>

Generate a category id based on its name and the user id.

Source

pub async fn generate_tag_id( &self, title: &str, client: &Client, ) -> Result<String, ApiError>

Generate a tag id based on its name and the user id.

Source

pub async fn category_all(&self, client: &Client) -> Result<String, ApiError>

The id of the global all tag of feedly.

Source

pub async fn tag_marked(&self, client: &Client) -> Result<String, ApiError>

The id of the global saved tag of feedly (starred articles).

Source

pub async fn tag_read(&self, client: &Client) -> Result<String, ApiError>

The id of the global read tag of feedly.

Source

pub async fn request_auth_token( client_id: &str, client_secret: &str, auth_code: AuthCode, client: &Client, ) -> Result<AccessTokenResponse, ApiError>

Generate a access_token from the AuthCode parsed from the redirect URL after successful OAuth.

Source

pub async fn refresh_auth_token( &self, client: &Client, ) -> Result<RefreshTokenResponse, ApiError>

Refresh the access_token after it expired.

Source

pub async fn get_profile(&self, client: &Client) -> Result<Profile, ApiError>

Source

pub async fn update_profile( &self, client: &Client, email: Option<String>, given_name: Option<String>, family_name: Option<String>, picture: Option<String>, gender: Option<bool>, locale: Option<String>, twitter: Option<String>, facebook: Option<String>, ) -> Result<Profile, ApiError>

Source

pub async fn get_categories( &self, client: &Client, ) -> Result<Vec<Category>, ApiError>

Source

pub async fn get_collections( &self, client: &Client, ) -> Result<Vec<Collection>, ApiError>

Source

pub async fn get_collection( &self, id: &str, client: &Client, ) -> Result<Vec<Collection>, ApiError>

Source

pub async fn update_category( &self, id: &str, label: &str, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn delete_category( &self, id: &str, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn get_subsriptions( &self, client: &Client, ) -> Result<Vec<Subscription>, ApiError>

Source

pub async fn create_or_update_collection( &self, collection: CollectionInput, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn add_feeds_to_collection( &self, collection_id: &str, feeds: Vec<CollectionFeedInput>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn remove_feeds_from_collection( &self, collection_id: &str, feeds: Vec<CollectionFeedInput>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn add_subscription( &self, subscription: SubscriptionInput, client: &Client, ) -> Result<(), ApiError>

Also updates existing subscriptions.

Source

pub async fn update_subscriptions( &self, subscriptions: Vec<SubscriptionInput>, client: &Client, ) -> Result<(), ApiError>

Same as add_subscription but update multiple subscriptions at once.

Source

pub async fn delete_subscription( &self, id: &str, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn get_tags(&self, client: &Client) -> Result<Vec<Tag>, ApiError>

Source

pub async fn tag_entry( &self, entry_id: &str, tag_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Add a tag to an entry (also used to mark entries as read or starred etc.).

Source

pub async fn tag_entries( &self, entry_ids: Vec<&str>, tag_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Same as tag_entry but for multiple entries at once.

Source

pub async fn update_tag( &self, tag_id: &str, label: &str, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn untag_entries( &self, entry_ids: Vec<&str>, tag_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn delete_tags( &self, tag_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn get_entries( &self, entry_ids: Vec<&str>, client: &Client, ) -> Result<Vec<Entry>, ApiError>

Source

pub async fn create_entry( &self, entry: Entry, client: &Client, ) -> Result<Vec<String>, ApiError>

Source

pub async fn get_stream( &self, stream_id: &str, continuation: Option<String>, count: Option<u32>, ranked: Option<&str>, unread_only: Option<bool>, newer_than: Option<u64>, client: &Client, ) -> Result<Stream, ApiError>

Source

pub async fn get_unread_counts( &self, client: &Client, ) -> Result<Counts, ApiError>

Source

pub async fn mark_entries_read( &self, entry_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn mark_entries_unread( &self, entry_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn mark_feeds_read( &self, feed_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn mark_categories_read( &self, category_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn mark_tags_read( &self, tag_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn mark_entries_saved( &self, entry_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn mark_entries_unsaved( &self, entry_ids: Vec<&str>, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn export_opml(&self, client: &Client) -> Result<String, ApiError>

Source

pub async fn import_opml( &self, opml: &str, client: &Client, ) -> Result<(), ApiError>

Source

pub async fn search_feedly_cloud( client: &Client, query: &str, count: Option<u32>, locale: Option<&str>, ) -> Result<SearchResult, ApiError>

Search the feedly cloud for new feeds to subscribe to

§Arguments
  • client - reqwest::Client
  • query - Can be a feed url, a site title, a site url or a #topic.
  • count - Number of results. Default value is 20.
  • locale - Locale hint for the search engine to return feeds in that localse (e.g. “pt”, “fr_FR”).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T