pub struct Hydrus { /* private fields */ }
Expand description

A high level wrapper for the hydrus API for easier management of files, tags urls etc.

Implementations§

source§

impl Hydrus

source

pub fn new(client: Client) -> Self

Creates a new high level Hydrus API client

source

pub async fn version(&self) -> Result<Version>

Returns the Hydrus and API Version

source

pub async fn services(&self) -> Result<Services>

Returns a list of available services

source

pub fn import(&self) -> ImportBuilder

Creates an import builder to build an import request to hydrus

source

pub fn address<S: AsRef<str> + Debug>(&self, address: S) -> Address

Returns the address as an object that can be used to get and set cookies

source

pub async fn url<S: AsRef<str> + Debug>(&self, url: S) -> Result<Url>

Returns information about a given url in an object that allows further operations with that url

source

pub async fn file(&self, identifier: FileIdentifier) -> Result<HydrusFile>

Returns a file by identifier to perform further operations on

source

pub async fn delete(&self) -> DeleteFilesBuilder

Creates a builder to delete files

source

pub fn tagging(&self) -> TaggingBuilder

Starts a request to bulk add tags to files

source

pub fn search(&self) -> SearchBuilder

Starts a request to search for files

source

pub fn search_tags<S: ToString>(&self, query: S) -> TagSearchBuilder

Starts a search request for tags with additional filter options

source

pub async fn page<S: AsRef<str> + Debug>( &self, page_key: S ) -> Result<HydrusPage>

Returns a hydrus page by page key

source

pub async fn root_page(&self) -> Result<HydrusPage>

Returns the root page in the client

source

pub async fn set_user_agent<S: ToString + Debug>( &self, user_agent: S ) -> Result<()>

Sets the user agent hydrus uses for http requests

source

pub async fn get_service_key( &self, service: ServiceIdentifier ) -> Result<String>

Returns the key for a given service identifier

Auto Trait Implementations§

§

impl !RefUnwindSafe for Hydrus

§

impl Send for Hydrus

§

impl Sync for Hydrus

§

impl Unpin for Hydrus

§

impl !UnwindSafe for Hydrus

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