Lines Matching refs:offset
77 pub fn $read(&self, offset: u32) -> $T
79 self.read_pod::<{ mem::size_of::<$T>() }, $T>(offset)
88 pub fn $write(&mut self, offset: u32, val: $T)
90 self.write_pod::<{ mem::size_of::<$T>() }, $T>(offset, val);
130 fn read_pod<const N: usize, T>(&self, offset: u32) -> T in read_pod()
135 let offset = usize::try_from(offset).unwrap(); in read_pod() localVariable
136 let end = offset.checked_add(N).unwrap(); in read_pod()
137 let bytes = self.data.get(offset..end).expect("out of bounds field"); in read_pod()
148 fn write_pod<const N: usize, T>(&mut self, offset: u32, val: T) in write_pod()
153 let offset = usize::try_from(offset).unwrap(); in write_pod() localVariable
154 let end = offset.checked_add(N).unwrap(); in write_pod()
155 let into = match self.data.get_mut(offset..end) { in write_pod()
172 pub fn slice(&self, offset: u32, len: u32) -> &[u8] { in slice()
173 let start = usize::try_from(offset).unwrap(); in slice()
186 pub fn slice_mut(&mut self, offset: u32, len: u32) -> &mut [u8] { in slice_mut()
187 let start = usize::try_from(offset).unwrap(); in slice_mut()
200 pub fn copy_from_slice(&mut self, offset: u32, src: &[u8]) { in copy_from_slice()
201 let offset = usize::try_from(offset).unwrap(); in copy_from_slice() localVariable
202 let end = offset.checked_add(src.len()).unwrap(); in copy_from_slice()
203 let into = self.data.get_mut(offset..end).expect("out of bounds copy"); in copy_from_slice()