pub struct MinifluxApi { /* private fields */ }

Implementations§

source§

impl MinifluxApi

source

pub fn new(url: &Url, username: String, password: String) -> Self

Create a new instance of the MinifluxApi.

  • url: url of the hosted Miniflux instance (e.g. https://reader.miniflux.app/)
  • username: user existing on said Miniflux instance
  • password: password of said user
source

pub fn new_from_token(url: &Url, token: String) -> Self

Create a new instance of the MinifluxApi using Token Auth.

  • url: url of the hosted Miniflux instance (e.g. https://reader.miniflux.app/)
  • token: token generated by Miniflux instance
source

pub async fn discover_subscription( &self, url: Url, client: &Client ) -> Result<Vec<Feed>, ApiError>

Try to find all available feeds (RSS/Atom) for a given website url.

  • url: url of a website with possible feeds (e.g. http://example.org)
source

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

Get all subscribed feeds.

source

pub async fn get_feed(&self, id: i64, client: &Client) -> Result<Feed, ApiError>

Get a specific feed by id.

source

pub async fn get_feed_icon( &self, id: i64, client: &Client ) -> Result<FavIcon, ApiError>

Get the FavIcon for a specific feed.

source

pub async fn create_feed( &self, feed_url: &Url, category_id: i64, client: &Client ) -> Result<i64, ApiError>

Subscribe to a feed.

  • feed_url: url to a RSS or Atom feed (e.g. http://example.org/feed.atom)
  • category_id: Miniflux internal id of a category the feed should be created in
source

pub async fn update_feed( &self, id: i64, title: Option<&str>, category_id: Option<i64>, feed_url: Option<&str>, site_url: Option<&str>, username: Option<&str>, password: Option<&str>, user_agent: Option<&str>, client: &Client ) -> Result<Feed, ApiError>

Update title and/or move feed to a different category.

  • id: Miniflux internal id of the feed to alter
  • title: new title of the feed
  • category_id: new parent category id
source

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

Refresh the contents of a feed synchronous on Miniflux. This operation can block the Miniflux instance for hundrets of milliseconds.

source

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

Unsubscribe from a feed.

source

pub async fn get_feed_entry( &self, feed_id: i64, entry_id: i64, client: &Client ) -> Result<Entry, ApiError>

Get a single specific entry (= article) from a feed.

source

pub async fn get_entry( &self, id: i64, client: &Client ) -> Result<Entry, ApiError>

Get a single specific entry (= article).

source

pub async fn get_entries( &self, status: Option<EntryStatus>, offset: Option<i64>, limit: Option<i64>, order: Option<OrderBy>, direction: Option<OrderDirection>, before: Option<i64>, after: Option<i64>, before_entry_id: Option<i64>, after_entry_id: Option<i64>, starred: Option<bool>, client: &Client ) -> Result<Vec<Entry>, ApiError>

Get a batch of entries (= articles).

source

pub async fn get_feed_entries( &self, id: i64, status: Option<EntryStatus>, offset: Option<i64>, limit: Option<i64>, order: Option<OrderBy>, direction: Option<OrderDirection>, before: Option<i64>, after: Option<i64>, before_entry_id: Option<i64>, after_entry_id: Option<i64>, starred: Option<bool>, client: &Client ) -> Result<Vec<Entry>, ApiError>

Get a batch of entries (= articles) from a specific feed. The field comments_url is available since Miniflux v2.0.5.

source

pub async fn update_entries_status( &self, ids: Vec<i64>, status: EntryStatus, client: &Client ) -> Result<(), ApiError>

Update the read status of a batch of entries (= articles).

source

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

Toggle the starred status of an entry (= article)

source

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

Get all categories

source

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

Create a new empty category

source

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

Rename a existing cagegory

source

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

Delete a existing category

source

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

Serialize all categories and subscribed feeds into a OPML string. This API call is available since Miniflux v2.0.1.

source

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

Parse OPML string, create all contained categories and subscribe to all contained feeds. This API call is available since Miniflux v2.0.7.

source

pub async fn create_user( &self, username: &str, password: &str, is_admin: bool, client: &Client ) -> Result<User, ApiError>

Create a new user on the Miniflux instance. You must be an administrator to create users.

source

pub async fn update_user( &self, id: i64, username: Option<String>, password: Option<String>, is_admin: Option<bool>, theme: Option<String>, language: Option<String>, timezone: Option<String>, entry_sorting_direction: Option<String>, client: &Client ) -> Result<User, ApiError>

Update details and/or credentials of a user. You must be an administrator to update users.

source

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

Get the user specified when this struct was created. This API endpoint is available since Miniflux v2.0.8.

source

pub async fn get_user_by_id( &self, id: i64, client: &Client ) -> Result<User, ApiError>

Get a specific user of the Miniflux instance. You must be an administrator to fetch users.

source

pub async fn get_user_by_name( &self, username: &str, client: &Client ) -> Result<User, ApiError>

Try to get a user by its username. You must be an administrator to fetch users.

source

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

Delete a user. You must be an administrator to delete users.

source

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

The healthcheck endpoint is useful for monitoring and load-balancer configuration.

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>,

§

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>,

§

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