The Cart Transform API documentation CartTransformRunResult shows that returning attributes in the result payload is possible for the linesMerge and linesExpand (expandedCartItems.attributes) operations, but it is not supported in the Rust implementation.
I get these errors when trying to set attributes in the correct places:
error[E0560]: struct `MergeOperation` has no field
named `attributes`
error[E0560]: struct `ExpandedItem` has no field
named `attributes`
Lines Merge: Cart Transform Function API
Lines Expand: Cart Transform Function API
Using the shopify_function crate v2.2.0