Struct wallabag_api::Client [−][src]
pub struct Client { /* fields omitted */ }Expand description
The main thing that provides all the methods for interacting with the Wallabag API.
Implementations
pub async fn check_urls_exist<T: Into<String>>(
&mut self,
urls: Vec<T>
) -> ClientResult<ExistsInfo>
pub async fn check_urls_exist<T: Into<String>>(
&mut self,
urls: Vec<T>
) -> ClientResult<ExistsInfo>
Check if a list of urls already have entries. This is more efficient if you want to batch check urls since only a single request is required. Returns a hashmap where the urls given are the keys and the values are either:
None: no existing entry corresponding to the urlSome(ID): an entry exists and here’s the ID
Check if a url already has a corresponding entry. Returns None if not existing or the ID
of the entry if it does exist.
Create a new entry. See docs for NewEntry for more information.
pub async fn update_entry<T: Into<ID>>(
&mut self,
id: T,
entry: &PatchEntry
) -> ClientResult<Entry>
pub async fn update_entry<T: Into<ID>>(
&mut self,
id: T,
entry: &PatchEntry
) -> ClientResult<Entry>
Update entry. To leave an editable field unchanged, set to None.
Reload entry. This tells the server to re-fetch content from the url (or origin url?) and use the result to refresh the entry contents.
This returns Err(ClientError::NotModified) if the server either could
not refresh the contents, or the content does not get modified.
Get an entry by id.
Delete an entry by id.
pub async fn update_annotation(
&mut self,
annotation: &Annotation
) -> ClientResult<Annotation>
pub async fn update_annotation(
&mut self,
annotation: &Annotation
) -> ClientResult<Annotation>
Update an annotation.
pub async fn create_annotation<T: Into<ID>>(
&mut self,
entry_id: T,
annotation: &NewAnnotation
) -> ClientResult<Annotation>
pub async fn create_annotation<T: Into<ID>>(
&mut self,
entry_id: T,
annotation: &NewAnnotation
) -> ClientResult<Annotation>
Create a new annotation on an entry.
Delete an annotation by id
Get all annotations for an entry (by id).
Get all entries.
pub async fn get_entries_with_filter(
&mut self,
filter: &EntriesFilter
) -> ClientResult<Entries>
pub async fn get_entries_with_filter(
&mut self,
filter: &EntriesFilter
) -> ClientResult<Entries>
Get all entries, filtered by filter parameters.
pub async fn get_entries_page(
&mut self,
filter: &EntriesFilter,
page_number: u32
) -> ClientResult<EntriesPage>
pub async fn get_entries_page(
&mut self,
filter: &EntriesFilter,
page_number: u32
) -> ClientResult<EntriesPage>
Get a page of entries, specified by page number. Useful when the expected list of results
is very large and you don’t want to wait too long before getting a subset of the entries.
Will return a not found error if page_number is out of bounds.
pub async fn export_entry<T: Into<ID>>(
&mut self,
entry_id: T,
fmt: Format
) -> ClientResult<String>
pub async fn export_entry<T: Into<ID>>(
&mut self,
entry_id: T,
fmt: Format
) -> ClientResult<String>
Get an export of an entry in a particular format.
Get a list of all tags for an entry by entry id.
Add tags to an entry by entry id. Idempotent operation. No problems if tags list is empty.
pub async fn delete_tag_from_entry<T: Into<ID>, U: Into<ID>>(
&mut self,
entry_id: T,
tag_id: U
) -> ClientResult<Entry>
pub async fn delete_tag_from_entry<T: Into<ID>, U: Into<ID>>(
&mut self,
entry_id: T,
tag_id: U
) -> ClientResult<Entry>
Delete a tag (by id) from an entry (by id). Returns err 404 if entry or tag not found. Idempotent. Removing a tag that exists but doesn’t exist on the entry completes without error.
Get a list of all tags.
Permanently delete a tag by id. This removes the tag from all entries. Appears to return success if attempting to delete a tag by id that exists on the server but isn’t accessible to the user.
pub async fn delete_tag_by_label<T: Into<String>>(
&mut self,
label: T
) -> ClientResult<DeletedTag>
pub async fn delete_tag_by_label<T: Into<String>>(
&mut self,
label: T
) -> ClientResult<DeletedTag>
Permanently delete a tag by label (tag names). This also exhibits the privacy breaching behaviour of returning tag info of other users’ tags. Also, labels aren’t necessarily unique across a wallabag installation. The server should filter by tags belonging to a user in the same db query.
Note: this allows deleting a tag with a comma by label.
Permanently batch delete tags by labels (tag names). Returns not found if all labels not found. If at least one found, then returns ok. For some reason, (at least the framabag instance) the server returns success and the tag data on attempting to delete for innaccessible tags (tags by other users?).
This method requires that tag names not contain commas. If you need to
delete a tag containing a comma, use delete_tag_by_label instead.
Returns a list of tags that were deleted (sans IDs). Returns 404 not found only if all tags were not found.
Get the API version. Probably not useful because if the version isn’t v2 then this library won’t work anyway.
Get the currently logged in user information.
pub async fn register_user(
&mut self,
info: &RegisterInfo
) -> ClientResult<NewlyRegisteredInfo>
pub async fn register_user(
&mut self,
info: &RegisterInfo
) -> ClientResult<NewlyRegisteredInfo>
Register a user and create a client.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Client
impl UnwindSafe for Client
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more