summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 12689c7..1d52d91 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -501,6 +501,24 @@ pub struct FieldSliceMut<'mv>
impl FieldSliceMut<'_>
{
+ pub fn get_item_mut(&mut self, item_index: usize) -> Option<FieldMut<'_>>
+ {
+ let start_off = item_index * self.field_metadata.size;
+
+ if item_index >= self.len {
+ return None;
+ }
+
+ let field_bytes = self
+ .bytes
+ .get_mut(start_off..start_off + self.field_metadata.size)?;
+
+ Some(FieldMut {
+ bytes: field_bytes,
+ field_metadata: self.field_metadata,
+ })
+ }
+
pub fn iter_mut(&mut self) -> FieldSliceIterMut<'_>
{
FieldSliceIterMut {