pub struct RustPaper {
pub config: Config,
pub config_folder: PathBuf,
pub wallpapers: Vec<String>,
pub wallpapers_list_file_location: PathBuf,
pub lock_file: Arc<Mutex<Option<LockFile>>>,
pub http_client: Client,
pub download_semaphore: Arc<Semaphore>,
}Expand description
Main RustPaper struct for managing wallpapers
Fields§
§config: Config§config_folder: PathBuf§wallpapers: Vec<String>§wallpapers_list_file_location: PathBuf§lock_file: Arc<Mutex<Option<LockFile>>>§http_client: Client§download_semaphore: Arc<Semaphore>Implementations§
Source§impl RustPaper
impl RustPaper
Sourcepub async fn add(&mut self, new_wallpapers: &mut Vec<String>) -> Result<()>
pub async fn add(&mut self, new_wallpapers: &mut Vec<String>) -> Result<()>
Add new wallpapers to the list
Sourcepub async fn remove(&mut self, ids_to_remove: &[String]) -> Result<()>
pub async fn remove(&mut self, ids_to_remove: &[String]) -> Result<()>
Remove wallpapers from the list
Sourcepub async fn clean(&mut self) -> Result<()>
pub async fn clean(&mut self) -> Result<()>
Clean up downloaded wallpapers that are no longer in the list
pub async fn info(&self, id: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for RustPaper
impl !RefUnwindSafe for RustPaper
impl Send for RustPaper
impl Sync for RustPaper
impl Unpin for RustPaper
impl UnsafeUnpin for RustPaper
impl !UnwindSafe for RustPaper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more