MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / from_raw

Method from_raw

rust/src/disassembly.rs:62–82  ·  view source on GitHub ↗
(value: &BNDisassemblyTextLine)

Source from the content-addressed store, hash-verified

60
61impl DisassemblyTextLine {
62 pub(crate) fn from_raw(value: &BNDisassemblyTextLine) -> Self {
63 let raw_tokens = unsafe { std::slice::from_raw_parts(value.tokens, value.count) };
64 let tokens: Vec<_> = raw_tokens
65 .iter()
66 .map(InstructionTextToken::from_raw)
67 .collect();
68 // SAFETY: Increment the tag ref as we are going from ref to owned.
69 let raw_tags = unsafe { std::slice::from_raw_parts(value.tags, value.tagCount) };
70 let tags: Vec<_> = raw_tags
71 .iter()
72 .map(|&t| unsafe { Tag::from_raw(t) }.to_owned())
73 .collect();
74 Self {
75 address: value.addr,
76 instruction_index: value.instrIndex,
77 tokens,
78 highlight: value.highlight.into(),
79 tags,
80 type_info: DisassemblyTextLineTypeInfo::from_raw(&value.typeInfo),
81 }
82 }
83
84 /// Convert into a raw [BNDisassemblyTextLine], use with caution.
85 ///

Callers

nothing calls this directly

Calls 5

raw_to_stringFunction · 0.85
mapMethod · 0.80
iterMethod · 0.45
to_ownedMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected