pub struct Target {
pub kind: TargetKind,
pub id: String,
pub chain: Option<String>,
pub venues: Vec<String>,
pub preset: Option<Preset>,
pub health: HealthOverrides,
pub rules: Vec<Rule>,
}Expand description
One thing a watchlist watches.
Fields§
§kind: TargetKind§id: StringA symbol, a contract address or a wallet address.
chain: Option<String>The chain; inferred when absent, as the CLI does.
venues: Vec<String>The venues, for market metrics, in the user’s order. Empty: none.
preset: Option<Preset>A preset, evaluated before the rules.
health: HealthOverridesHealth threshold overrides for the preset and the market metrics.
rules: Vec<Rule>Implementations§
Source§impl Target
impl Target
Sourcepub fn new(kind: TargetKind, id: impl Into<String>) -> Self
pub fn new(kind: TargetKind, id: impl Into<String>) -> Self
A target with no venue, preset or rules.
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
The name of the whole target: USDC@binance, USDC@binance,okx,
or the id.
Sourcepub fn row_label(&self, venue: Option<&str>) -> String
pub fn row_label(&self, venue: Option<&str>) -> String
The label of one row of the target: USDC@binance on a venue, the
id without one.
Sourcepub fn rows(&self) -> Vec<Option<&str>>
pub fn rows(&self) -> Vec<Option<&str>>
The rows the target gives, by venue (None: the id row). One venue
or none: one row with every cell. Two or more: one market row per
venue, then an id row when token or address rules need one (design
2026-11-04, section 2.3). With no market metric, the venues read
nothing, so the target is its id row alone.
Sourcepub fn needs_market(&self) -> bool
pub fn needs_market(&self) -> bool
Whether the target reads a market summary (preset or a market rule).
Sourcepub fn needs(&self, group: MetricGroup) -> bool
pub fn needs(&self, group: MetricGroup) -> bool
Whether any rule reads a metric of group.