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

Method set_sni_callback

crates/stdlib/src/ssl.rs:1639–1653  ·  view source on GitHub ↗
(
            &self,
            callback: Option<PyObjectRef>,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

1637
1638 #[pygetset(setter)]
1639 fn set_sni_callback(
1640 &self,
1641 callback: Option<PyObjectRef>,
1642 vm: &VirtualMachine,
1643 ) -> PyResult<()> {
1644 // Validate callback is callable or None
1645 if let Some(ref cb) = callback
1646 && !cb.is(vm.ctx.types.none_type)
1647 && !cb.is_callable()
1648 {
1649 return Err(vm.new_type_error("sni_callback must be callable or None"));
1650 }
1651 *self.sni_callback.write() = callback;
1652 Ok(())
1653 }
1654
1655 #[pymethod]
1656 fn set_servername_callback(

Callers 1

Calls 4

isMethod · 0.80
is_callableMethod · 0.80
ErrClass · 0.50
writeMethod · 0.45

Tested by

no test coverage detected