MCPcopy Index your code
hub / github.com/RustPython/RustPython / id

Method id

crates/stdlib/src/ssl.rs:4736–4745  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

4734
4735 #[pygetset]
4736 fn id(&self, vm: &VirtualMachine) -> PyBytesRef {
4737 // Return session ID (hash of session data for uniqueness)
4738
4739 let mut hasher = DefaultHasher::new();
4740 self.session_data.hash(&mut hasher);
4741 let hash = hasher.finish();
4742
4743 // Convert hash to bytes
4744 vm.ctx.new_bytes(hash.to_be_bytes().to_vec())
4745 }
4746
4747 #[pygetset]
4748 fn has_ticket(&self) -> bool {

Callers 3

py_newMethod · 0.45
initMethod · 0.45
check_threadMethod · 0.45

Calls 5

newFunction · 0.85
to_vecMethod · 0.80
hashMethod · 0.45
finishMethod · 0.45
new_bytesMethod · 0.45

Tested by

no test coverage detected