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

Function obj2py

crates/stdlib/src/openssl.rs:393–409  ·  view source on GitHub ↗
(obj: &Asn1ObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

391
392 type PyNid = (libc::c_int, String, String, Option<String>);
393 fn obj2py(obj: &Asn1ObjectRef, vm: &VirtualMachine) -> PyResult<PyNid> {
394 let nid = obj.nid();
395 let short_name = nid
396 .short_name()
397 .map_err(|_| vm.new_value_error("NID has no short name"))?
398 .to_owned();
399 let long_name = nid
400 .long_name()
401 .map_err(|_| vm.new_value_error("NID has no long name"))?
402 .to_owned();
403 Ok((
404 nid.as_raw(),
405 short_name,
406 long_name,
407 cert::obj2txt(obj, true),
408 ))
409 }
410
411 #[derive(FromArgs)]
412 struct Txt2ObjArgs {

Callers 2

txt2objFunction · 0.85
nid2objFunction · 0.85

Calls 3

obj2txtFunction · 0.85
to_ownedMethod · 0.45
as_rawMethod · 0.45

Tested by

no test coverage detected