fn read(self, bytes: OptionalOption<i64>, vm: &VirtualMachine) -> PyResult {
        let data = match self.buffer.borrow_mut().read(byte_count(bytes)) {
            Some(value) => value,
            None => Vec::new(),
        };

        match String::from_utf8(data) {
            Ok(value) => Ok(vm.ctx.new_str(value)),
            Err(_) => Err(vm.new_value_error("Error Retrieving Value".to_string())),
        }
    }
//Read k bytes from the object and return.
//If k is undefined || k == -1, then we read all bytes until the end of the file.
//This also increments the stream position by the value of k
Read k bytes from the object and return.
If k is undefined || k == -1, then we read all bytes until the end of the file.
This also increments the stream position by the value of k
Read k bytes from the object and return . If k is undefined || k == - 1 then we read all bytes until the end of the file . This also increments the stream position by the value of k
fn read(self, bytes: OptionalOption<i64>, vm: &VirtualMachine) -> PyResult {
        let data = match self.buffer.borrow_mut().read(byte_count(bytes)) {
            Some(value) => value,
            None => Vec::new(),
        };
        match String::from_utf8(data) {
            Ok(value) => Ok(vm.ctx.new_str(value)),
            Err(_) => Err(vm.new_value_error("Error Retrieving Value".to_string())),
        }
    }
fn read ( self , bytes : OptionalOption < i64 > , vm : & VirtualMachine ) -> PyResult { let data = match self . buffer . borrow_mut ( ) . read ( byte_count ( bytes ) ) { Some ( value ) => value , None => Vec :: new ( ) , } ; match String :: from_utf8 ( data ) { Ok ( value ) => Ok ( vm . ctx . new_str ( value ) ) , Err ( _ ) => Err ( vm . new_value_error ( " " . to_string ( ) ) ) , } }
Read k bytes from the object and return.
Read k bytes from the object and return .
self
bytes
OptionalOption<i64>
vm
&VirtualMachine