pub struct ReplacementService { /* private fields */ }Expand description
Unified replacement service using Terraphim knowledge graphs.
Implementations§
Source§impl ReplacementService
impl ReplacementService
Sourcepub fn with_link_type(self, link_type: AutomataLinkType) -> Self
pub fn with_link_type(self, link_type: AutomataLinkType) -> Self
Set the link type for replacements.
Sourcepub fn replace(&self, text: &str) -> Result<HookResult, ReplacementError>
pub fn replace(&self, text: &str) -> Result<HookResult, ReplacementError>
Perform replacement on text.
Sourcepub fn replace_fail_open(&self, text: &str) -> HookResult
pub fn replace_fail_open(&self, text: &str) -> HookResult
Perform replacement with fail-open semantics.
If replacement fails, returns the original text unchanged with error in result.
Sourcepub fn find_matches(&self, text: &str) -> Result<Vec<Matched>, ReplacementError>
pub fn find_matches(&self, text: &str) -> Result<Vec<Matched>, ReplacementError>
Find matches in text without replacing.
Sourcepub fn contains_matches(&self, text: &str) -> bool
pub fn contains_matches(&self, text: &str) -> bool
Check if text contains any terms from the thesaurus.
Auto Trait Implementations§
impl Freeze for ReplacementService
impl RefUnwindSafe for ReplacementService
impl Send for ReplacementService
impl Sync for ReplacementService
impl Unpin for ReplacementService
impl UnsafeUnpin for ReplacementService
impl UnwindSafe for ReplacementService
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