pub struct ExactReplacement {
pub type: TypeTrue,
pub replace_all_enabled: Option<bool>,
pub key: String,
pub value: String,
}Fields§
§type: TypeTrueThis is the exact replacement type. You can use this to replace a specific word or phrase with a different word or phrase. Usage: - Replace "hello" with "hi": { type: ‘exact’, key: ‘hello’, value: ‘hi’ } - Replace "good morning" with "good day": { type: ‘exact’, key: ‘good morning’, value: ‘good day’ } - Replace a specific name: { type: ‘exact’, key: ‘John Doe’, value: ‘Jane Smith’ } - Replace an acronym: { type: ‘exact’, key: ‘AI’, value: ‘Artificial Intelligence’ } - Replace a company name with its phonetic pronunciation: { type: ‘exact’, key: ‘Vapi’, value: ‘Vappy’ }
replace_all_enabled: Option<bool>This option let’s you control whether to replace all instances of the key or only the first one. By default, it only replaces the first instance. Examples: - For { type: ‘exact’, key: ‘hello’, value: ‘hi’, replaceAllEnabled: false }. Before: "hello world, hello universe" | After: "hi world, hello universe" - For { type: ‘exact’, key: ‘hello’, value: ‘hi’, replaceAllEnabled: true }. Before: "hello world, hello universe" | After: "hi world, hi universe" @default false
key: StringThis is the key to replace.
value: StringThis is the value that will replace the match.
Implementations§
Trait Implementations§
Source§impl Clone for ExactReplacement
impl Clone for ExactReplacement
Source§fn clone(&self) -> ExactReplacement
fn clone(&self) -> ExactReplacement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExactReplacement
impl Debug for ExactReplacement
Source§impl Default for ExactReplacement
impl Default for ExactReplacement
Source§fn default() -> ExactReplacement
fn default() -> ExactReplacement
Source§impl<'de> Deserialize<'de> for ExactReplacement
impl<'de> Deserialize<'de> for ExactReplacement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ExactReplacement
impl PartialEq for ExactReplacement
Source§fn eq(&self, other: &ExactReplacement) -> bool
fn eq(&self, other: &ExactReplacement) -> bool
self and other values to be equal, and is used by ==.