MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / union_v

Method union_v

debugger/src/debugger/value_writer.rs:238–263  ·  view source on GitHub ↗
(
        &mut self,
        ty: &UnionType,
        index: usize,
        fields: I,
    )

Source from the content-addressed store, hash-verified

236 }
237
238 fn union_v<I: Iterator<Item = (String, Bytes)>>(
239 &mut self,
240 ty: &UnionType,
241 index: usize,
242 fields: I,
243 ) -> Bytes {
244 let mut msg = Bytes::new();
245 let mut len: usize = 0;
246 for (n, v) in fields {
247 msg.identifier(&n);
248 msg.push_bytes(v);
249 msg.space();
250 len += 1;
251 }
252 msg.integer(len);
253 msg.integer(index);
254 msg.identifier(&ty.name);
255 len = 0;
256 for v in &ty.variants {
257 msg.identifier(v);
258 len += 1;
259 }
260 msg.integer(len);
261 msg.push_str("union_decl");
262 msg
263 }
264
265 fn vector_v<I: Iterator<Item = Bytes>>(&self, iter: I) -> Bytes {
266 let mut msg = Bytes::new();

Callers 2

write_valueFunction · 0.45
write_union_withFunction · 0.45

Calls 5

identifierMethod · 0.80
push_bytesMethod · 0.80
spaceMethod · 0.80
integerMethod · 0.80
push_strMethod · 0.80

Tested by

no test coverage detected