pub struct ThreadOperators;Expand description
Thread operators available for ReCoco flows.
These operators integrate Thread’s semantic code analysis capabilities into ReCoco’s dataflow engine for incremental, cached code parsing.
§Available Operators
§Functions (Transforms)
§thread_parse
Parse source code into AST with semantic extraction.
Inputs:
content(String): Source code contentlanguage(String): Language identifier (extension or name)file_path(String, optional): File path for context
Output: Struct with fields:
symbols(LTable): Symbol definitionsimports(LTable): Import statementscalls(LTable): Function calls
§extract_symbols
Extract symbol table from parsed document.
Inputs:
parsed_document(Struct): Output fromthread_parse
Output: LTable with fields:
name(String): Symbol namekind(String): Symbol kind (function, class, etc.)scope(String): Scope identifier
§extract_imports
Extract import statements from parsed document.
Inputs:
parsed_document(Struct): Output fromthread_parse
Output: LTable with fields:
symbol_name(String): Imported symbol namesource_path(String): Import source pathkind(String): Import kind
§extract_calls
Extract function calls from parsed document.
Inputs:
parsed_document(Struct): Output fromthread_parse
Output: LTable with fields:
function_name(String): Called function namearguments_count(Int64): Number of arguments
§Targets (Export Destinations)
§d1
Export data to Cloudflare D1 edge database.
Configuration:
account_id(String): Cloudflare account IDdatabase_id(String): D1 database IDapi_token(String): Cloudflare API tokentable_name(String): Target table name
Features:
- Content-addressed deduplication via primary key
- UPSERT pattern (INSERT … ON CONFLICT DO UPDATE)
- Batch operations for efficiency
- Edge-distributed caching
Implementations§
Source§impl ThreadOperators
impl ThreadOperators
Sourcepub const OPERATORS: &'static [&'static str]
pub const OPERATORS: &'static [&'static str]
List of all available Thread operator names (functions).
Sourcepub const TARGETS: &'static [&'static str]
pub const TARGETS: &'static [&'static str]
List of all available Thread target names (export destinations).
Sourcepub fn is_thread_operator(name: &str) -> bool
pub fn is_thread_operator(name: &str) -> bool
Check if an operator name is a Thread operator.
Sourcepub fn is_thread_target(name: &str) -> bool
pub fn is_thread_target(name: &str) -> bool
Check if a target name is a Thread target.
Sourcepub fn register_all(
registry: &mut ExecutorFactoryRegistry,
) -> Result<(), RecocoError>
pub fn register_all( registry: &mut ExecutorFactoryRegistry, ) -> Result<(), RecocoError>
Register all Thread operators with the provided registry.
This function creates instances of all Thread operator factories and registers them using the SimpleFunctionFactoryBase::register() and TargetFactoryBase::register() methods.
§Example
use recoco::ops::sdk::ExecutorFactoryRegistry;
use thread_flow::ThreadOperators;
let mut registry = ExecutorFactoryRegistry::new();
ThreadOperators::register_all(&mut registry)?;Auto Trait Implementations§
impl Freeze for ThreadOperators
impl RefUnwindSafe for ThreadOperators
impl Send for ThreadOperators
impl Sync for ThreadOperators
impl Unpin for ThreadOperators
impl UnsafeUnpin for ThreadOperators
impl UnwindSafe for ThreadOperators
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> 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