pub struct PlanCompiler { /* private fields */ }Expand description
Compiler that converts SWC AST to ExecutionPlan.
Implementations§
Source§impl PlanCompiler
impl PlanCompiler
Sourcepub fn with_config(config: &ExecutionConfig) -> Self
pub fn with_config(config: &ExecutionConfig) -> Self
Create a new compiler with custom config.
Sourcepub fn with_sdk_operations(self, operations: HashSet<String>) -> Self
pub fn with_sdk_operations(self, operations: HashSet<String>) -> Self
Set the allowed SDK operation names. When non-empty, the compiler operates in SDK mode:
api.<operation>(args) is compiled to SdkCall instead of HTTP ApiCall.
Sourcepub fn compile_code(
&mut self,
code: &str,
) -> Result<ExecutionPlan, CompileError>
pub fn compile_code( &mut self, code: &str, ) -> Result<ExecutionPlan, CompileError>
Compile JavaScript code to an execution plan.
This is a convenience method that parses the code and compiles it.
Sourcepub fn compile(
&mut self,
module: &Module,
) -> Result<ExecutionPlan, CompileError>
pub fn compile( &mut self, module: &Module, ) -> Result<ExecutionPlan, CompileError>
Compile a module to an execution plan.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlanCompiler
impl RefUnwindSafe for PlanCompiler
impl Send for PlanCompiler
impl Sync for PlanCompiler
impl Unpin for PlanCompiler
impl UnsafeUnpin for PlanCompiler
impl UnwindSafe for PlanCompiler
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.