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

Method build

crates/vm/src/stdlib/_io.rs:2593–2609  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

2591 }
2592
2593 fn build(&self) -> BigInt {
2594 let mut buf = [0; Self::BYTE_LEN];
2595 macro_rules! set_field {
2596 ($field:expr, $off:ident) => {{
2597 let field = $field;
2598 buf[Self::$off..][..core::mem::size_of_val(&field)]
2599 .copy_from_slice(&field.to_ne_bytes())
2600 }};
2601 }
2602 set_field!(self.start_pos, START_POS_OFF);
2603 set_field!(self.dec_flags, DEC_FLAGS_OFF);
2604 set_field!(self.bytes_to_feed, BYTES_TO_FEED_OFF);
2605 set_field!(self.chars_to_skip, CHARS_TO_SKIP_OFF);
2606 set_field!(self.need_eof as u8, NEED_EOF_OFF);
2607 set_field!(self.bytes_to_skip, BYTES_TO_SKIP_OFF);
2608 BigInt::from_signed_bytes_le(&buf)
2609 }
2610
2611 fn set_decoder_state(&self, decoder: &PyObject, vm: &VirtualMachine) -> PyResult<()> {
2612 if self.start_pos == 0 && self.dec_flags == 0 {

Callers 4

symlinkFunction · 0.45
tellMethod · 0.45
renameFunction · 0.45
linkFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected