pub struct InMemoryEsSync { /* private fields */ }Expand description
In-memory EsSync implementation backed by a HashMap<index, HashMap<id, EsDocument>>.
⚠️ MOCK 实现——仅供单元测试与本地开发,请勿用于生产环境。
- 数据存储在进程内
HashMap,重启即丢失 - 不支持分布式、副本、分片、持久化等任何 ES 生产特性
- 查询语义为简化版,不保证与真实 ES 行为一致
Suitable for unit tests and small in-process workloads.
search supports MatchAll, Term (exact match), Terms (membership),
Range (numeric/string bounds), and Bool (must/should/must_not).
Clone 通过 Arc 共享内部状态——克隆的是引用而非数据副本。
Implementations§
Trait Implementations§
Source§impl Clone for InMemoryEsSync
impl Clone for InMemoryEsSync
Source§fn clone(&self) -> InMemoryEsSync
fn clone(&self) -> InMemoryEsSync
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for InMemoryEsSync
impl Default for InMemoryEsSync
Source§impl EsSync for InMemoryEsSync
impl EsSync for InMemoryEsSync
fn sync_to_es( &self, documents: Vec<EsDocument>, ) -> Result<EsSyncResult, EsError>
fn delete_from_es( &self, index: &str, ids: Vec<String>, ) -> Result<EsSyncResult, EsError>
fn search(&self, request: EsSearchRequest) -> Result<EsSearchResult, EsError>
Auto Trait Implementations§
impl Freeze for InMemoryEsSync
impl RefUnwindSafe for InMemoryEsSync
impl Send for InMemoryEsSync
impl Sync for InMemoryEsSync
impl Unpin for InMemoryEsSync
impl UnsafeUnpin for InMemoryEsSync
impl UnwindSafe for InMemoryEsSync
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