Skip to main content

Searchable

Trait Searchable 

Source
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., TableMatches for DB/Loc files).

Required Associated Types§

Source

type SearchMatches

The type containing search results for this searchable type.

Required Methods§

Source

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 regex
  • case_sensitive - Whether matching should be case-sensitive
  • matching_mode - How to interpret the pattern (literal vs regex)
§Returns

A match result struct containing all found matches with their locations.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Searchable for AnimFragmentBattle

Source§

type SearchMatches = AnimFragmentBattleMatches

Source§

fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> AnimFragmentBattleMatches

Source§

impl Searchable for Atlas

Source§

type SearchMatches = AtlasMatches

Source§

fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> AtlasMatches

Source§

impl Searchable for DB

Source§

type SearchMatches = TableMatches

Source§

fn search( &self, file_path: &str, pattern_to_search: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> TableMatches

Source§

impl Searchable for Loc

Source§

type SearchMatches = TableMatches

Source§

fn search( &self, file_path: &str, pattern_to_search: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> TableMatches

Source§

impl Searchable for PortraitSettings

Source§

type SearchMatches = PortraitSettingsMatches

Source§

fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> PortraitSettingsMatches

Source§

impl Searchable for RigidModel

Source§

type SearchMatches = RigidModelMatches

Source§

fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> RigidModelMatches

Source§

impl Searchable for Schema

Source§

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.

Source§

type SearchMatches = SchemaMatches

Source§

impl Searchable for Text

Source§

type SearchMatches = TextMatches

Source§

fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> TextMatches

Source§

impl Searchable for UnitVariant

Source§

type SearchMatches = UnitVariantMatches

Source§

fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> UnitVariantMatches

Source§

impl Searchable for Unknown

Source§

type SearchMatches = UnknownMatches

Source§

fn search( &self, file_path: &str, pattern: &str, case_sensitive: bool, matching_mode: &MatchingMode, ) -> UnknownMatches

Implementors§