Skip to main content

EntryStore

Trait EntryStore 

Source
pub trait EntryStore: Send + Sync {
    // Required methods
    fn get(&self, index: u32) -> Result<Arc<DictEntry>, DictError>;
    fn get_entries_at(
        &self,
        first_index: u32,
        surface: &str,
    ) -> Result<Vec<Arc<DictEntry>>, DictError>;
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

사전 엔트리 저장소 인터페이스

Eager/Lazy 로드 모드를 추상화합니다.

Required Methods§

Source

fn get(&self, index: u32) -> Result<Arc<DictEntry>, DictError>

인덱스로 엔트리 조회

§Errors
  • 인덱스가 범위를 벗어난 경우
  • Lazy 모드에서 디스크 읽기 실패 시
Source

fn get_entries_at( &self, first_index: u32, surface: &str, ) -> Result<Vec<Arc<DictEntry>>, DictError>

인덱스에서 시작하여 같은 surface를 가진 연속된 엔트리 반환

§Errors
  • 인덱스가 범위를 벗어난 경우
  • Lazy 모드에서 디스크 읽기 실패 시
Source

fn len(&self) -> usize

엔트리 수 반환

Provided Methods§

Source

fn is_empty(&self) -> bool

비어있는지 확인

Implementors§