Skip to main content

StreamingFieldResolver

Struct StreamingFieldResolver 

Source
pub struct StreamingFieldResolver;
Expand description

Shared streaming-virtual-fields resolver for e2e test codegen.

Implementations§

Source§

impl StreamingFieldResolver

Source

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.

Source

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.

Source

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.

Source

pub fn collect_snippet_zig( stream_var: &str, chunks_var: &str, module_name: &str, ffi_prefix: &str, ) -> String

Render Zig’s streaming collect snippet using the configured module and FFI prefix.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more