Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

ZeroCopyCache

Struct ZeroCopyCache 

Source
pub struct ZeroCopyCache { /* private fields */ }
Expand description

하이브리드 파일 캐시 관리자

  • 작은 파일: 메모리에 완전히 로드하여 캐시
  • 큰 파일: 필요할 때마다 memmap2 사용 (캐시 안함)

Implementations§

Source§

impl ZeroCopyCache

Source

pub fn new( max_cache_files: usize, max_cache_file_size: usize, total_cache_size_limit: usize, cache_duration: Duration, ) -> Self

Source

pub fn from_config(config: CacheConfig) -> Self

설정으로부터 캐시 생성

Source

pub fn default() -> Self

기본 설정으로 캐시 생성

Source

pub fn init_global(config: Option<CacheConfig>) -> Result<(), &'static str>

전역 캐시 초기화 (한 번만 호출)

Source

pub fn global() -> &'static ZeroCopyCache

전역 캐시 인스턴스 반환

Source

pub fn load_file<P: AsRef<Path>>( &self, path: P, ) -> Result<FileLoadResult, SendableError>

파일을 로드 (캐시 사용 또는 직접 로드)

Source

pub fn cleanup_expired(&self)

만료된 캐시 항목 정리

Source

pub fn stats(&self) -> CacheStats

캐시 통계

Source

pub fn clear_cache(&self)

캐시 강제 정리

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.