MCPcopy Create free account
hub / github.com/PerroEngine/Perro / predicate_matches

Method predicate_matches

perro_source/core/perro_csv/src/lib.rs:775–824  ·  view source on GitHub ↗
(&self, row_idx: usize, predicate: &CsvPredicate)

Source from the content-addressed store, hash-verified

773 }
774 keyed.sort_unstable_by(cmp);
775 rows.clear();
776 rows.extend(keyed.iter().map(|(row, _, _)| *row));
777 }
778 } else if let Some(limit) = self.limit {
779 rows.truncate(limit);
780 }
781 CSVQueryResult {
782 table: self.table,
783 rows,
784 select_cols: self.select_cols.clone(),
785 }
786 }
787
788 fn add_text(mut self, logic: CsvLogic, col: &str, op: CsvCompare, value: &str) -> Self {
789 self.filters.push(CsvFilter {
790 logic,
791 predicate: CsvPredicate::Text {
792 col: self.col(col),
793 op,
794 value: value.to_string(),
795 hash: perro_ids::string_to_u64(value),
796 },
797 });
798 self
799 }
800
801 fn add_number(mut self, logic: CsvLogic, col: &str, op: CsvCompare, value: f64) -> Self {
802 self.filters.push(CsvFilter {
803 logic,
804 predicate: CsvPredicate::Number {
805 col: self.col(col),
806 op,
807 value,
808 },
809 });
810 self
811 }
812
813 fn add_contains(mut self, logic: CsvLogic, col: &str, needle: &str) -> Self {
814 self.filters.push(CsvFilter {
815 logic,
816 predicate: CsvPredicate::Contains {
817 col: self.col(col),
818 needle: needle.to_string(),
819 },
820 });
821 self
822 }
823
824 fn add_starts_with(mut self, logic: CsvLogic, col: &str, prefix: &str) -> Self {
825 self.filters.push(CsvFilter {
826 logic,
827 predicate: CsvPredicate::StartsWith {

Callers 1

matchesMethod · 0.80

Calls 9

compare_boolFunction · 0.85
compare_ordFunction · 0.85
okMethod · 0.80
anyMethod · 0.80
rowMethod · 0.45
getMethod · 0.45
as_strMethod · 0.45
containsMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected