MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / record_lift

Method record_lift

crates/rust/src/bindgen.rs:125–142  ·  view source on GitHub ↗
(
        &mut self,
        id: TypeId,
        ty: &Record,
        operands: &[String],
        results: &mut Vec<String>,
    )

Source from the content-addressed store, hash-verified

123 }
124
125 fn record_lift(
126 &mut self,
127 id: TypeId,
128 ty: &Record,
129 operands: &[String],
130 results: &mut Vec<String>,
131 ) {
132 let mut result = self.typename_lift(id);
133 result.push_str("{\n");
134 for (field, val) in ty.fields.iter().zip(operands) {
135 result.push_str(&to_rust_ident(&field.name));
136 result.push_str(": ");
137 result.push_str(val);
138 result.push_str(",\n");
139 }
140 result.push('}');
141 results.push(result);
142 }
143
144 fn tuple_lower(&mut self, tuple: &Tuple, operand: &str, results: &mut Vec<String>) {
145 let tmp = self.tmp();

Callers 1

emitMethod · 0.80

Calls 5

to_rust_identFunction · 0.85
typename_liftMethod · 0.80
push_strMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected