MCPcopy Create free account
hub / github.com/ElementsProject/lightning / get

Method get

plugins/lsps-plugin/src/core/tlv.rs:127–132  ·  view source on GitHub ↗

Get a reference to the value of a TLV record by type.

(&self, type_: u64)

Source from the content-addressed store, hash-verified

125
126 /// Get a reference to the value of a TLV record by type.
127 pub fn get(&self, type_: u64) -> Option<&[u8]> {
128 self.0
129 .iter()
130 .find(|rec| rec.type_ == type_)
131 .map(|rec| rec.value.as_slice())
132 }
133
134 /// Insert a TLV record (replaces if type already exists).
135 pub fn insert(&mut self, type_: u64, value: Vec<u8>) {

Callers 15

conftest.pyFile · 0.45
output_typeFunction · 0.45
output_memberFunction · 0.45
output_arrayFunction · 0.45
has_membersFunction · 0.45
output_membersFunction · 0.45
generate_headerFunction · 0.45
generate_descriptionFunction · 0.45
generate_return_valueFunction · 0.45
generate_footerFunction · 0.45

Calls 1

mapMethod · 0.80

Tested by 15

test_networkeventsFunction · 0.36
dict_subset_eqFunction · 0.36
test_live_spendableFunction · 0.36
test_limits_fake_gossmapFunction · 0.36
test_migrationFunction · 0.36
test_recoverFunction · 0.36
test_relative_config_dirFunction · 0.36
test_includeFunction · 0.36
test_config_in_subdirFunction · 0.36
restore_valgrindFunction · 0.36
test_testnet_upgradeFunction · 0.36
test_regtest_upgradeFunction · 0.36