pub struct StreamingFieldResolver;Expand description
Shared streaming-virtual-fields resolver for e2e test codegen.
Implementations§
Source§impl StreamingFieldResolver
impl StreamingFieldResolver
Sourcepub fn accessor(field: &str, lang: &str, chunks_var: &str) -> Option<String>
pub fn accessor(field: &str, lang: &str, chunks_var: &str) -> Option<String>
Returns the language-specific expression for a streaming-virtual field,
given chunks_var (the collected-list local name) and lang.
Returns None when the field name is not a known streaming-virtual
field or the language has no streaming support.
module_qualifier carries the per-project module/crate name used by the
Rust and C# stream.has_*_event branches to construct the CrawlEvent
type path. Pass the cargo crate name (snake_case) for Rust callers and
the C# namespace (PascalCase) for C# callers. When None is supplied
for those branches, the accessor returns None so the call site can
skip the assertion rather than emit code referencing an unknown type.
Sourcepub fn accessor_with_module_qualifier(
field: &str,
lang: &str,
chunks_var: &str,
module_qualifier: Option<&str>,
) -> Option<String>
pub fn accessor_with_module_qualifier( field: &str, lang: &str, chunks_var: &str, module_qualifier: Option<&str>, ) -> Option<String>
Same as Self::accessor but accepts a per-project module qualifier
for the stream.has_*_event branches that emit a CrawlEvent type path.
Sourcepub fn collect_snippet(
lang: &str,
stream_var: &str,
chunks_var: &str,
) -> Option<String>
pub fn collect_snippet( lang: &str, stream_var: &str, chunks_var: &str, ) -> Option<String>
Returns the language-specific stream-collect-into-list snippet that
produces chunks_var from stream_var.
Returns None when the language has no streaming collect support or
when the collect snippet cannot be expressed generically.