pub struct ZeroCopyCache { /* private fields */ }Expand description
하이브리드 파일 캐시 관리자
- 작은 파일: 메모리에 완전히 로드하여 캐시
- 큰 파일: 필요할 때마다 memmap2 사용 (캐시 안함)
Implementations§
Source§impl ZeroCopyCache
impl ZeroCopyCache
pub fn new( max_cache_files: usize, max_cache_file_size: usize, total_cache_size_limit: usize, cache_duration: Duration, ) -> Self
Sourcepub fn from_config(config: CacheConfig) -> Self
pub fn from_config(config: CacheConfig) -> Self
설정으로부터 캐시 생성
Sourcepub fn init_global(config: Option<CacheConfig>) -> Result<(), &'static str>
pub fn init_global(config: Option<CacheConfig>) -> Result<(), &'static str>
전역 캐시 초기화 (한 번만 호출)
Sourcepub fn global() -> &'static ZeroCopyCache
pub fn global() -> &'static ZeroCopyCache
전역 캐시 인스턴스 반환
Sourcepub fn load_file<P: AsRef<Path>>(
&self,
path: P,
) -> Result<FileLoadResult, SendableError>
pub fn load_file<P: AsRef<Path>>( &self, path: P, ) -> Result<FileLoadResult, SendableError>
파일을 로드 (캐시 사용 또는 직접 로드)
Sourcepub fn cleanup_expired(&self)
pub fn cleanup_expired(&self)
만료된 캐시 항목 정리
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
캐시 통계
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
캐시 강제 정리
Auto Trait Implementations§
impl Freeze for ZeroCopyCache
impl !RefUnwindSafe for ZeroCopyCache
impl Send for ZeroCopyCache
impl Sync for ZeroCopyCache
impl Unpin for ZeroCopyCache
impl UnsafeUnpin for ZeroCopyCache
impl !UnwindSafe for ZeroCopyCache
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