pub struct OwnedIconCache {
pub lock: FileLock,
pub memmap: Mmap,
}Expand description
Provides access to an IconCache constructed from a file that is guaranteed not to be modified.
OwnedIconCache holds a lock on the cache file and creates a memory-mapped region with the file’s
contents inside. It does not copy the file contents.
To access the icon cache, use OwnedIconCache::icon_cache
Fields§
§lock: FileLock§memmap: MmapImplementations§
Source§impl OwnedIconCache
impl OwnedIconCache
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Open and lock a file. This call may block waiting to acquire a lock if an exclusive lock is already held.
If this behaviour is undesirable, use open_non_blocking instead.
Sourcepub fn open_non_blocking(path: impl AsRef<Path>) -> Result<Self>
pub fn open_non_blocking(path: impl AsRef<Path>) -> Result<Self>
Open and lock a file, returning an error if an exclusive lock on the file was already held by another process.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OwnedIconCache
impl RefUnwindSafe for OwnedIconCache
impl Send for OwnedIconCache
impl Sync for OwnedIconCache
impl Unpin for OwnedIconCache
impl UnwindSafe for OwnedIconCache
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