pub enum TransformPattern {
Direct,
MethodCall {
extra_args: Vec<String>,
},
PropertyToMethod,
Constructor {
method: String,
},
ReorderArgs {
indices: Vec<usize>,
},
TypedTemplate {
pattern: String,
params: Vec<String>,
param_types: Vec<ParamType>,
},
Template {
template: String,
},
}Expand description
Transformation patterns for Python→Rust mapping
Variants§
Direct
Direct 1:1 rename
MethodCall
Method call with extra arguments
PropertyToMethod
Property to method conversion
Constructor
Constructor pattern (e.g., DataFrame() → DataFrame::new())
ReorderArgs
Argument reordering [31]
TypedTemplate
Type-safe template with validation [32, 33]
Template
👎Deprecated: Use TypedTemplate for type-safe templates
Legacy template (deprecated)
Implementations§
Source§impl TransformPattern
impl TransformPattern
Sourcepub fn validate_reorder_args(indices: &[usize]) -> Result<(), ValidationError>
pub fn validate_reorder_args(indices: &[usize]) -> Result<(), ValidationError>
Validate a ReorderArgs pattern
Indices must be a valid permutation (0..n where n = indices.len())
Sourcepub fn validate_typed_template(
pattern: &str,
params: &[String],
param_types: &[ParamType],
) -> Result<(), ValidationError>
pub fn validate_typed_template( pattern: &str, params: &[String], param_types: &[ParamType], ) -> Result<(), ValidationError>
Validate a TypedTemplate pattern
Params must match placeholders in pattern, and lengths must match
Trait Implementations§
Source§impl Clone for TransformPattern
impl Clone for TransformPattern
Source§fn clone(&self) -> TransformPattern
fn clone(&self) -> TransformPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransformPattern
impl Debug for TransformPattern
Source§impl Default for TransformPattern
impl Default for TransformPattern
Source§fn default() -> TransformPattern
fn default() -> TransformPattern
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TransformPattern
impl<'de> Deserialize<'de> for TransformPattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TransformPattern
impl PartialEq for TransformPattern
Source§impl Serialize for TransformPattern
impl Serialize for TransformPattern
impl StructuralPartialEq for TransformPattern
Auto Trait Implementations§
impl Freeze for TransformPattern
impl RefUnwindSafe for TransformPattern
impl Send for TransformPattern
impl Sync for TransformPattern
impl Unpin for TransformPattern
impl UnwindSafe for TransformPattern
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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