pub trait IntoRustTuple {
type Tuple;
// Required method
fn into_rust_tuple(self) -> Self::Tuple;
}Expand description
Moves a canonical list into a native Rust tuple in logical source order.
Canonical lists terminate in CNil<()>. Native tuple bridges support zero
through twelve fields; lists themselves have no arity limit. Nested list
fields remain lists rather than being recursively converted or flattened.
Conversion requires no cloning, equality, or formatting capabilities.
§Examples
use cel_runtime::{IntoCStackList, IntoRustTuple};
let list = (String::from("left"), 7_u8, 2.5_f64).into_c_stack_list();
let value: (String, u8, f64) = list.into_rust_tuple();
assert_eq!(value, (String::from("left"), 7, 2.5));Required Associated Types§
Required Methods§
Sourcefn into_rust_tuple(self) -> Self::Tuple
fn into_rust_tuple(self) -> Self::Tuple
Moves each logical field into the corresponding native tuple field.
- Complexity: O(n) field moves for n fields, without heap allocation.
§Examples
use cel_runtime::{IntoCStackList, IntoRustTuple};
let value: (String,) = (String::from("owned"),)
.into_c_stack_list()
.into_rust_tuple();
assert_eq!(value.0, "owned");Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".