pub struct HotReloadDictionary { /* private fields */ }Expand description
핫 리로드 가능한 사전
RwLock으로 동시 접근을 제어하며, Copy-on-Write 전략으로 무중단 업데이트를 지원합니다.
Implementations§
Source§impl HotReloadDictionary
impl HotReloadDictionary
Sourcepub fn new<P>(dicdir: P) -> Result<HotReloadDictionary, DictError>
pub fn new<P>(dicdir: P) -> Result<HotReloadDictionary, DictError>
Sourcepub fn new_default() -> Result<HotReloadDictionary, DictError>
pub fn new_default() -> Result<HotReloadDictionary, DictError>
Sourcepub const fn with_max_history(self, max_history: usize) -> HotReloadDictionary
pub const fn with_max_history(self, max_history: usize) -> HotReloadDictionary
최대 버전 히스토리 크기 설정
Sourcepub const fn with_max_delta_queue(
self,
max_delta_queue: usize,
) -> HotReloadDictionary
pub const fn with_max_delta_queue( self, max_delta_queue: usize, ) -> HotReloadDictionary
최대 델타 큐 크기 설정
Sourcepub fn current_version(&self) -> u64
pub fn current_version(&self) -> u64
현재 버전 반환
Sourcepub fn add_entry(
&self,
surface: impl Into<String>,
pos: impl Into<String>,
cost: i16,
reading: Option<String>,
) -> Result<u64, DictError>
pub fn add_entry( &self, surface: impl Into<String>, pos: impl Into<String>, cost: i16, reading: Option<String>, ) -> Result<u64, DictError>
Sourcepub fn apply_delta(&self, delta: DeltaUpdate) -> Result<u64, DictError>
pub fn apply_delta(&self, delta: DeltaUpdate) -> Result<u64, DictError>
Sourcepub fn reload_system_dict(&self) -> Result<u64, DictError>
pub fn reload_system_dict(&self) -> Result<u64, DictError>
시스템 사전 리로드
사전 파일이 변경되었을 때 호출됩니다.
§Errors
Returns an error if the dictionary files cannot be reloaded or the lock cannot be acquired.
Sourcepub fn version_history(&self) -> Result<Vec<VersionInfo>, DictError>
pub fn version_history(&self) -> Result<Vec<VersionInfo>, DictError>
Sourcepub fn delta_history(&self) -> Result<Vec<DeltaUpdate>, DictError>
pub fn delta_history(&self) -> Result<Vec<DeltaUpdate>, DictError>
Sourcepub fn export_user_dict(&self) -> Result<UserDictionary, DictError>
pub fn export_user_dict(&self) -> Result<UserDictionary, DictError>
Sourcepub fn import_user_dict(
&self,
user_dict: UserDictionary,
) -> Result<u64, DictError>
pub fn import_user_dict( &self, user_dict: UserDictionary, ) -> Result<u64, DictError>
Auto Trait Implementations§
impl Freeze for HotReloadDictionary
impl RefUnwindSafe for HotReloadDictionary
impl Send for HotReloadDictionary
impl Sync for HotReloadDictionary
impl Unpin for HotReloadDictionary
impl UnsafeUnpin for HotReloadDictionary
impl UnwindSafe for HotReloadDictionary
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more