pub struct ScriptTexts { /* private fields */ }Expand description
Finds text('key', 'Source') calls in JavaScript, TypeScript, Vue and Svelte files.
Each call is matched on its own, from its name to its second argument. The file is never
followed as a whole: JSX text and Vue or Svelte markup carry unescaped apostrophes (l'Andorra)
that would derail anything tracking strings across the file.
Implementations§
Source§impl ScriptTexts
impl ScriptTexts
Sourcepub fn new(functions: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn new(functions: impl IntoIterator<Item = impl Into<String>>) -> Self
A scanner for calls to these names, such as text and $text.
Sourcepub fn extract_bytes(&self, content: &[u8]) -> Extracted
pub fn extract_bytes(&self, content: &[u8]) -> Extracted
Read the calls in the bytes of a file. A file that is not valid UTF-8 is reported, not half read.
Trait Implementations§
Source§impl Clone for ScriptTexts
impl Clone for ScriptTexts
Auto Trait Implementations§
impl Forget for ScriptTexts
impl Freeze for ScriptTexts
impl Move for ScriptTexts
impl RefUnwindSafe for ScriptTexts
impl Send for ScriptTextswhere
RawVecInner: Send,
impl Sync for ScriptTextswhere
RawVecInner: Sync,
impl Unpin for ScriptTexts
impl UnsafeUnpin for ScriptTexts
impl UnwindSafe for ScriptTextswhere
RawVecInner: UnwindSafe,
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