MCPcopy Create free account
hub / github.com/FeatureProbe/server-sdk-rust / match_segment

Method match_segment

src/evaluate.rs:452–466  ·  view source on GitHub ↗
(
        &self,
        user: &FPUser,
        predicate: &str,
        segment_repo: Option<&HashMap<String, Segment>>,
    )

Source from the content-addressed store, hash-verified

450 }
451
452 fn match_segment(
453 &self,
454 user: &FPUser,
455 predicate: &str,
456 segment_repo: Option<&HashMap<String, Segment>>,
457 ) -> bool {
458 match segment_repo {
459 None => false,
460 Some(repo) => match predicate {
461 "is in" => self.user_in_segments(user, repo),
462 "is not in" => !self.user_in_segments(user, repo),
463 _ => false,
464 },
465 }
466 }
467
468 fn match_string(&self, user: &FPUser, predicate: &str) -> bool {
469 if let Some(c) = user.get(&self.subject) {

Callers 1

meetMethod · 0.80

Calls 1

user_in_segmentsMethod · 0.80

Tested by

no test coverage detected