Struct hydrus_api::wrapper::hydrus_file::HydrusFile
source · [−]pub struct HydrusFile {
pub id: FileIdentifier,
pub status: FileStatus,
/* private fields */
}
Fields
id: FileIdentifier
status: FileStatus
Implementations
sourceimpl HydrusFile
impl HydrusFile
sourcepub async fn update(&mut self) -> Result<()>
pub async fn update(&mut self) -> Result<()>
Deletes the internally stored metadata about the file retrieves it again
sourcepub async fn hash(&mut self) -> Result<String>
pub async fn hash(&mut self) -> Result<String>
Returns the hash of the file if the file identifier is an id it calls hydrus to resolve the file
sourcepub async fn dimensions(&mut self) -> Result<Option<(u32, u32)>>
pub async fn dimensions(&mut self) -> Result<Option<(u32, u32)>>
Returns the dimensions of the file in pixels
sourcepub async fn duration(&mut self) -> Result<Option<u64>>
pub async fn duration(&mut self) -> Result<Option<u64>>
Returns the duration of the file in seconds if it’s a video
sourcepub async fn num_frames(&mut self) -> Result<Option<u64>>
pub async fn num_frames(&mut self) -> Result<Option<u64>>
Returns the number of frames of the file if it’s a video
sourcepub async fn stored_locally(&mut self) -> Result<bool>
pub async fn stored_locally(&mut self) -> Result<bool>
Returns if the file is stored locally
sourcepub async fn moved_to_trashed(&mut self) -> Result<bool>
pub async fn moved_to_trashed(&mut self) -> Result<bool>
Returns if the file has been moved to the trash
sourcepub async fn time_modified(&mut self) -> Result<Option<NaiveDateTime>>
pub async fn time_modified(&mut self) -> Result<Option<NaiveDateTime>>
Returns the modified time of the file
sourcepub async fn time_imported<S: AsRef<str>>(
&mut self,
service_key: S
) -> Result<Option<NaiveDateTime>>
pub async fn time_imported<S: AsRef<str>>(
&mut self,
service_key: S
) -> Result<Option<NaiveDateTime>>
Returns the imported time of the file for a given file service key
sourcepub async fn time_deleted<S: AsRef<str>>(
&mut self,
service_key: S
) -> Result<Option<NaiveDateTime>>
pub async fn time_deleted<S: AsRef<str>>(
&mut self,
service_key: S
) -> Result<Option<NaiveDateTime>>
Returns the time the file was deleted for a specified file service
sourcepub async fn associate_urls(&mut self, urls: Vec<String>) -> Result<()>
pub async fn associate_urls(&mut self, urls: Vec<String>) -> Result<()>
Associates the file with a list of urls
sourcepub async fn disassociate_urls(&mut self, urls: Vec<String>) -> Result<()>
pub async fn disassociate_urls(&mut self, urls: Vec<String>) -> Result<()>
Disassociates the file with a list of urls
👎 Deprecated: Deprecated in the official API. Use services_with_tags instead.
Deprecated in the official API. Use services_with_tags instead.
Returns map mapping lists of tags to services.
Deprecation: Use HydrusFile::services_with_tags instead.
Returns a mapping with service ids mapped to tags
Returns a list of all tags assigned to the file
Adds tags for a specific service to the file
Allows modification of tags by using the defined tag actions
sourcepub fn add_notes(&self) -> AddNotesBuilder
pub fn add_notes(&self) -> AddNotesBuilder
Creates a builder to add notes to the file
sourcepub async fn delete_note<S1: ToString>(&self, name: S1) -> Result<()>
pub async fn delete_note<S1: ToString>(&self, name: S1) -> Result<()>
Deletes a single note from the file
sourcepub async fn delete_notes<I: IntoIterator<Item = S>, S: ToString>(
&self,
names: I
) -> Result<()>
pub async fn delete_notes<I: IntoIterator<Item = S>, S: ToString>(
&self,
names: I
) -> Result<()>
Deletes multiple notes from the file
sourcepub async fn retrieve(&self) -> Result<FileRecord>
pub async fn retrieve(&self) -> Result<FileRecord>
Retrieves the file record bytes
Trait Implementations
sourceimpl Clone for HydrusFile
impl Clone for HydrusFile
sourcefn clone(&self) -> HydrusFile
fn clone(&self) -> HydrusFile
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for HydrusFile
impl Send for HydrusFile
impl Sync for HydrusFile
impl Unpin for HydrusFile
impl !UnwindSafe for HydrusFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more