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

Method write

crates/stdlib/src/openssl.rs:2380–2393  ·  view source on GitHub ↗
(&mut self, buf: &[u8])

Source from the content-addressed store, hash-verified

2378
2379 impl Write for BioStream {
2380 fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
2381 // Write to outgoing MemoryBIO
2382 unsafe {
2383 let nbytes = sys::BIO_write(
2384 self.outbio.bio,
2385 buf.as_ptr() as *const _,
2386 buf.len().min(i32::MAX as usize) as i32,
2387 );
2388 if nbytes < 0 {
2389 return Err(std::io::Error::other("BIO write failed"));
2390 }
2391 Ok(nbytes as usize)
2392 }
2393 }
2394
2395 fn flush(&mut self) -> std::io::Result<()> {
2396 // MemoryBIO doesn't need flushing

Callers 5

builderMethod · 0.45
set_ownerMethod · 0.45
set_contextMethod · 0.45
do_handshakeMethod · 0.45
readMethod · 0.45

Calls 15

convert_ssl_errorFunction · 0.85
timeout_error_msgFunction · 0.85
socket_closed_errorFunction · 0.85
new_ssl_errorFunction · 0.85
convert_openssl_errorFunction · 0.85
getFunction · 0.85
is_bioMethod · 0.80
ssl_writeMethod · 0.80
get_refMethod · 0.80
timeout_deadlineMethod · 0.80
upcastMethod · 0.80
socket_needsMethod · 0.80

Tested by

no test coverage detected