pub struct Cache { /* private fields */ }
Expand description
A cache for volume, credentials and audio files.
Implementations§
Source§impl Cache
impl Cache
pub fn new<P: AsRef<Path>>( credentials_path: Option<P>, volume_path: Option<P>, audio_path: Option<P>, size_limit: Option<u64>, ) -> Result<Self, Error>
pub fn credentials(&self) -> Option<Credentials>
pub fn save_credentials(&self, cred: &Credentials)
pub fn volume(&self) -> Option<u16>
pub fn save_volume(&self, volume: u16)
pub fn file_path(&self, file: FileId) -> Option<PathBuf>
pub fn file(&self, file: FileId) -> Option<File>
pub fn save_file<F: Read>( &self, file: FileId, contents: &mut F, ) -> Result<PathBuf, Error>
pub fn remove_file(&self, file: FileId) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cache
impl !RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl !UnwindSafe for Cache
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