pub struct ComponentFilter { /* private fields */ }Implementations§
Source§impl ComponentFilter
impl ComponentFilter
Sourcepub fn MinimumTVL(min_tvl: f64) -> ComponentFilter
👎Deprecated since 0.9.2: Please use with_tvl_range instead
pub fn MinimumTVL(min_tvl: f64) -> ComponentFilter
Please use with_tvl_range instead
Creates a ComponentFilter that filters components based on a minimum Total Value Locked
(TVL) threshold.
§Arguments
min_tvl- The minimum TVL required for a component to be tracked. This is denominated in native token of the chain.
Sourcepub fn with_tvl_range(
remove_tvl_threshold: f64,
add_tvl_threshold: f64,
) -> ComponentFilter
pub fn with_tvl_range( remove_tvl_threshold: f64, add_tvl_threshold: f64, ) -> ComponentFilter
Creates a ComponentFilter with a specified TVL range for adding or removing components
from tracking.
Components that drop below the remove_tvl_threshold will be removed from tracking,
while components that exceed the add_tvl_threshold will be added to tracking.
This approach helps to reduce fluctuations caused by components hovering around a single
threshold.
§Arguments
remove_tvl_threshold- The TVL below which a component will be removed from tracking.add_tvl_threshold- The TVL above which a component will be added to tracking.
Note: thresholds are denominated in native token of the chain.
Sourcepub fn Ids(ids: Vec<ComponentId>) -> ComponentFilter
pub fn Ids(ids: Vec<ComponentId>) -> ComponentFilter
Creates a ComponentFilter that includes only the components with the specified IDs,
effectively filtering out all other components.
§Arguments
ids- A vector of component IDs to include in the filter. Only components with these IDs will be tracked.
Sourcepub fn blocklist(self, ids: impl IntoIterator<Item = ComponentId>) -> Self
pub fn blocklist(self, ids: impl IntoIterator<Item = ComponentId>) -> Self
Blocklist specific component IDs from tracking regardless of other filter criteria. IDs are normalized to lowercase.
Has no effect when the filter variant is Ids, since the
inclusion list already defines exactly which components to track.
Sourcepub fn is_blocklisted(&self, id: &str) -> bool
pub fn is_blocklisted(&self, id: &str) -> bool
Returns true if the given component ID is blocklisted.
Trait Implementations§
Source§impl Clone for ComponentFilter
impl Clone for ComponentFilter
Source§fn clone(&self) -> ComponentFilter
fn clone(&self) -> ComponentFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ComponentFilter
impl RefUnwindSafe for ComponentFilter
impl Send for ComponentFilter
impl Sync for ComponentFilter
impl Unpin for ComponentFilter
impl UnsafeUnpin for ComponentFilter
impl UnwindSafe for ComponentFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more