pub struct SourceDecl {
pub name: Ident,
pub provider: Ident,
pub clock: Option<ClockPolicy>,
pub path: Option<StringLiteral>,
pub watch: Option<StringLiteral>,
pub url: Option<StringLiteral>,
pub dedup: Option<SourceValue>,
pub observe_binding: Ident,
pub emit: SourceEmit,
pub span: SourceSpan,
}Expand description
A top-level source declaration: source <provider> as <name> { ... } or
source clock as <name> { ... }. Lowers through the source_declaration
construct family to a signal_source (generic provider) or clock_source
(the clock provider) admission template (spec/std-time.md,
spec/construct-grammar.md). A source admits a durable signal fact; it never
fires a rule directly.
Fields§
§name: Identas <name> — the source instance name.
provider: IdentThe provider keyword (clock) or a generic provider identifier.
clock: Option<ClockPolicy>Recurrence/timezone/missed policy; Some only for the clock provider.
path: Option<StringLiteral>path "<file>" — file provider, line mode (exactly one of
path/watch); rejected elsewhere. The file is read line-by-line; each
non-empty line is admitted once as a durable signal fact
(spec/std-time.md admission semantics, append-only).
watch: Option<StringLiteral>watch "<glob>" — file provider, occurrence mode (exactly one of
path/watch); rejected elsewhere (spec/std-ingress.md I2a). Each
matched file is admitted once per new (path, content-hash) occurrence:
a dropped file admits once, an unchanged file never re-admits, a
content change re-admits. Content READING stays std.files.
url: Option<StringLiteral>url "<url>" — required for the http provider, rejected elsewhere. The
URL is GET’d and its JSON-array body admitted one element per signal,
keyed by (source, element index) so re-polls are idempotent (append-only).
dedup: Option<SourceValue>dedup <observe>.<field> — optional provider delivery-id source for
file (line mode) and http sources (spec/std-ingress.md I2a): the
named observation field becomes the admission key instead of the
positional ordinal, so a re-ordered or head-inserted feed still admits
each delivery exactly once.
observe_binding: Identobserve as <binding> — binds the provider observation schema.
emit: SourceEmitemit <signal> { <field> <value> ... } — maps the observation into the
declared signal payload.
span: SourceSpanTrait Implementations§
Source§impl Clone for SourceDecl
impl Clone for SourceDecl
Source§fn clone(&self) -> SourceDecl
fn clone(&self) -> SourceDecl
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more