Skip to main content

IntoRustTuple

Trait IntoRustTuple 

Source
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§

Source

type Tuple

The native tuple type with fields in logical source order.

Required Methods§

Source

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".

Implementors§

Source§

impl IntoRustTuple for CNil<()>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static, L: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CStackList<K, CStackList<L, CNil<()>>>>>>>>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static, K: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CStackList<K, CNil<()>>>>>>>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CStackList<J, CNil<()>>>>>>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CStackList<I, CNil<()>>>>>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CStackList<H, CNil<()>>>>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CStackList<G, CNil<()>>>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CStackList<F, CNil<()>>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CStackList<E, CNil<()>>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static, D: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CStackList<D, CNil<()>>>>>

Source§

impl<A: 'static, B: 'static, C: 'static> IntoRustTuple for CStackList<A, CStackList<B, CStackList<C, CNil<()>>>>

Source§

impl<A: 'static, B: 'static> IntoRustTuple for CStackList<A, CStackList<B, CNil<()>>>

Source§

impl<A: 'static> IntoRustTuple for CStackList<A, CNil<()>>