Skip to content

Commit

Permalink
Merge branch 'riccardo/feat/generic-filters' of github.com:getsentry/…
Browse files Browse the repository at this point in the history
…relay into riccardo/feat/generic-filters
  • Loading branch information
iambriccardo committed Jul 5, 2024
2 parents 909e0ab + fa67d18 commit b8157bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions relay-protocol/src/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,22 +737,22 @@ impl RuleCondition {
}
}

/// Creates a [`AnyCondition`].
/// Creates an [`AnyCondition`].
///
/// # Example
///
/// ```
/// use relay_protocol::RuleCondition;
///
/// let condition = RuleCondition::for_any("event.exceptions",
/// let condition = RuleCondition::for_any("event.exception.values",
/// RuleCondition::eq("name", "NullPointerException")
/// );
/// ```
pub fn for_any(field: impl Into<String>, inner: RuleCondition) -> Self {
Self::Any(AnyCondition::new(field, inner))
}

/// Creates a [`AllCondition`].
/// Creates an [`AllCondition`].
///
/// # Example
///
Expand Down
12 changes: 7 additions & 5 deletions relay-protocol/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ pub trait IntoValue: Debug + Empty {
}
}

/// Hides an iterator of [`Getter`]s that is used to iterate over arbitrary [`Getter`]
/// implementations.
/// A type-erased iterator over a collection of [`Getter`]s.
///
/// This type is usually returned from [`Getter::get_iter`].
///
/// # Example
///
Expand Down Expand Up @@ -202,7 +203,7 @@ impl<'a> GetterIter<'a> {
}
}

/// Creates a new [`GetterIter`] given an element that can be converted into an iterator of
/// Creates a new [`GetterIter`] given a collection of
/// [`Annotated`]s whose type implement [`Getter`].
pub fn new_annotated<I, T>(iterator: I) -> Self
where
Expand Down Expand Up @@ -293,8 +294,9 @@ pub trait Getter {
/// Returns the serialized value of a field pointed to by a `path`.
fn get_value(&self, path: &str) -> Option<Val<'_>>;

/// Returns a [`GetterIter`] that allows iteration on [`Getter`] implementations
/// of fields pointed on by `path`.
/// Returns an iterator over the array pointed to by a `path`.
///
/// If the path does not exist or is not an array, this returns `None`. Note that `get_value` may not return a value for paths that expose an iterator.
fn get_iter(&self, _path: &str) -> Option<GetterIter<'_>> {
None
}
Expand Down

0 comments on commit b8157bf

Please sign in to comment.