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

Method parse_cadata_arg

crates/stdlib/src/ssl.rs:2171–2180  ·  view source on GitHub ↗

Helper: Parse cadata argument (str or bytes)

(
            &self,
            arg: &Either<PyStrRef, ArgBytesLike>,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

2169
2170 /// Helper: Parse cadata argument (str or bytes)
2171 fn parse_cadata_arg(
2172 &self,
2173 arg: &Either<PyStrRef, ArgBytesLike>,
2174 vm: &VirtualMachine,
2175 ) -> PyResult<Vec<u8>> {
2176 match arg {
2177 Either::A(s) => Ok(s.clone().try_into_utf8(vm)?.as_str().as_bytes().to_vec()),
2178 Either::B(b) => Ok(b.borrow_buf().to_vec()),
2179 }
2180 }
2181
2182 /// Helper: Update certificate statistics
2183 fn update_cert_stats(&self, stats: cert::CertStats) {

Callers 1

load_verify_locationsMethod · 0.80

Calls 6

to_vecMethod · 0.80
try_into_utf8Method · 0.80
as_bytesMethod · 0.45
as_strMethod · 0.45
cloneMethod · 0.45
borrow_bufMethod · 0.45

Tested by

no test coverage detected