Method
_from_bytes
(&self, b: &[u8], itemsize: usize, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 847 | } |
| 848 | |
| 849 | fn _from_bytes(&self, b: &[u8], itemsize: usize, vm: &VirtualMachine) -> PyResult<()> { |
| 850 | if !b.len().is_multiple_of(itemsize) { |
| 851 | return Err(vm.new_value_error("bytes length not a multiple of item size")); |
| 852 | } |
| 853 | if b.len() / itemsize > 0 { |
| 854 | self.try_resizable(vm)?.frombytes(b); |
| 855 | } |
| 856 | Ok(()) |
| 857 | } |
| 858 | |
| 859 | #[pymethod] |
| 860 | fn frombytes(&self, b: ArgBytesLike, vm: &VirtualMachine) -> PyResult<()> { |
Tested by
no test coverage detected