pub trait Searchable {
type SearchMatches;
// Required method
fn search(
&self,
file_path: &str,
pattern_to_search: &str,
case_sensitive: bool,
matching_mode: &MatchingMode,
) -> Self::SearchMatches;
}Expand description
Trait for file types that support text searching.
Implementors of this trait can be scanned for text matches using various matching modes (pattern, regex, case-sensitive, etc.).
§Associated Types
SearchMatches: The type returned containing match results, specific to each file type (e.g.,TableMatchesfor DB/Loc files).
Required Associated Types§
Sourcetype SearchMatches
type SearchMatches
The type containing search results for this searchable type.
Required Methods§
Sourcefn search(
&self,
file_path: &str,
pattern_to_search: &str,
case_sensitive: bool,
matching_mode: &MatchingMode,
) -> Self::SearchMatches
fn search( &self, file_path: &str, pattern_to_search: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> Self::SearchMatches
Performs a search and returns all matches.
§Arguments
file_path- Path of the file being searched (for result reporting)pattern_to_search- The search pattern or regexcase_sensitive- Whether matching should be case-sensitivematching_mode- How to interpret the pattern (literal vs regex)
§Returns
A match result struct containing all found matches with their locations.
Implementations on Foreign Types§
Source§impl Searchable for AnimFragmentBattle
impl Searchable for AnimFragmentBattle
type SearchMatches = AnimFragmentBattleMatches
fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> AnimFragmentBattleMatches
Source§impl Searchable for Atlas
impl Searchable for Atlas
type SearchMatches = AtlasMatches
fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> AtlasMatches
Source§impl Searchable for DB
impl Searchable for DB
type SearchMatches = TableMatches
fn search( &self, file_path: &str, pattern_to_search: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> TableMatches
Source§impl Searchable for Loc
impl Searchable for Loc
type SearchMatches = TableMatches
fn search( &self, file_path: &str, pattern_to_search: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> TableMatches
Source§impl Searchable for PortraitSettings
impl Searchable for PortraitSettings
type SearchMatches = PortraitSettingsMatches
fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> PortraitSettingsMatches
Source§impl Searchable for RigidModel
impl Searchable for RigidModel
type SearchMatches = RigidModelMatches
fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> RigidModelMatches
Source§impl Searchable for Text
impl Searchable for Text
type SearchMatches = TextMatches
fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> TextMatches
Source§impl Searchable for UnitVariant
impl Searchable for UnitVariant
type SearchMatches = UnitVariantMatches
fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> UnitVariantMatches
Source§impl Searchable for Unknown
impl Searchable for Unknown
type SearchMatches = UnknownMatches
fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> UnknownMatches
Source§impl Searchable for Schema
impl Searchable for Schema
Source§fn search(
&self,
_file_path: &str,
pattern_to_search: &str,
case_sensitive: bool,
matching_mode: &MatchingMode,
) -> SchemaMatches
fn search( &self, _file_path: &str, pattern_to_search: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> SchemaMatches
This function performs a search over the provided Text PackedFile.