pub struct EsSyncManager { /* private fields */ }Implementations§
Source§impl EsSyncManager
impl EsSyncManager
Sourcepub fn new() -> Self
pub fn new() -> Self
创建默认 Manager(使用 Mock 后端,仅供测试)。
⚠️ 生产环境请使用 EsSyncManager::with_backend 注入真实 ES 客户端实现。
Sourcepub fn with_backend(backend: Box<dyn EsSync>) -> Self
pub fn with_backend(backend: Box<dyn EsSync>) -> Self
pub fn create_index( &mut self, index: impl Into<String>, mapping: HashMap<String, EsFieldType>, )
pub fn get_mapping(&self, index: &str) -> Option<&HashMap<String, EsFieldType>>
pub fn sync_to_es( &self, documents: Vec<EsDocument>, ) -> Result<EsSyncResult, EsError>
pub fn delete_from_es( &self, index: &str, ids: Vec<String>, ) -> Result<EsSyncResult, EsError>
pub fn search( &self, request: EsSearchRequest, ) -> Result<EsSearchResult, EsError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for EsSyncManager
impl !UnwindSafe for EsSyncManager
impl Freeze for EsSyncManager
impl Send for EsSyncManager
impl Sync for EsSyncManager
impl Unpin for EsSyncManager
impl UnsafeUnpin for EsSyncManager
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