pub struct HydrusFile {
pub id: FileIdentifier,
pub status: FileStatus,
/* private fields */
}Fields§
§id: FileIdentifier§status: FileStatusImplementations§
Source§impl 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 fn delete(&mut self) -> DeleteFilesBuilder
pub fn delete(&mut self) -> DeleteFilesBuilder
Creates a request builder to delete the file
Sourcepub async fn undelete(
&mut self,
service_selection: FileServiceSelection,
) -> Result<()>
pub async fn undelete( &mut self, service_selection: FileServiceSelection, ) -> Result<()>
Undeletes the file for the given service or all services
if FileServiceSelection::none is passed
Sourcepub async fn archive(
&mut self,
service_selection: FileServiceSelection,
) -> Result<()>
pub async fn archive( &mut self, service_selection: FileServiceSelection, ) -> Result<()>
Archives the file in all passed file services or all configured services if no selection is passed
Sourcepub async fn unarchive(
&mut self,
service_selection: FileServiceSelection,
) -> Result<()>
pub async fn unarchive( &mut self, service_selection: FileServiceSelection, ) -> Result<()>
Unarchives the file for the given services
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.
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§
Source§impl Clone for HydrusFile
impl Clone for HydrusFile
Source§fn clone(&self) -> HydrusFile
fn clone(&self) -> HydrusFile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more