pub struct DynamicParamProcessor;Expand description
Processor for dynamic parameter placeholders
Implementations§
Source§impl DynamicParamProcessor
impl DynamicParamProcessor
Sourcepub fn has_dynamic_placeholders(value: &str) -> bool
pub fn has_dynamic_placeholders(value: &str) -> bool
Check if a string contains any dynamic placeholders
Sourcepub fn extract_placeholders(value: &str) -> HashSet<DynamicPlaceholder>
pub fn extract_placeholders(value: &str) -> HashSet<DynamicPlaceholder>
Extract all placeholders from a string
Sourcepub fn process_value(value: &str) -> ProcessedValue
pub fn process_value(value: &str) -> ProcessedValue
Process a string value, converting placeholders to k6 expressions
Input: “load-test-vu-${__VU}”
Output: ProcessedValue { value: “load-test-vu-${__VU}”, is_dynamic: true, … }
Sourcepub fn process_json_value(value: &Value) -> (Value, HashSet<DynamicPlaceholder>)
pub fn process_json_value(value: &Value) -> (Value, HashSet<DynamicPlaceholder>)
Process a JSON value recursively, handling dynamic placeholders
Sourcepub fn process_json_body(body: &Value) -> ProcessedBody
pub fn process_json_body(body: &Value) -> ProcessedBody
Process an entire JSON body for dynamic placeholders
Returns a JavaScript-ready body string that may contain template literals
Sourcepub fn process_path(path: &str) -> ProcessedValue
pub fn process_path(path: &str) -> ProcessedValue
Process a URL path for dynamic placeholders
Sourcepub fn get_required_imports(
placeholders: &HashSet<DynamicPlaceholder>,
) -> Vec<&'static str>
pub fn get_required_imports( placeholders: &HashSet<DynamicPlaceholder>, ) -> Vec<&'static str>
Get all required imports based on placeholders used
Sourcepub fn get_required_globals(
placeholders: &HashSet<DynamicPlaceholder>,
) -> Vec<&'static str>
pub fn get_required_globals( placeholders: &HashSet<DynamicPlaceholder>, ) -> Vec<&'static str>
Get all required global initializations based on placeholders used
Auto Trait Implementations§
impl Freeze for DynamicParamProcessor
impl RefUnwindSafe for DynamicParamProcessor
impl Send for DynamicParamProcessor
impl Sync for DynamicParamProcessor
impl Unpin for DynamicParamProcessor
impl UnwindSafe for DynamicParamProcessor
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 more