From 61a976b94727c139bc93b702657dbcd3779482be Mon Sep 17 00:00:00 2001 From: JakkuSakura Date: Tue, 21 May 2024 03:11:08 +0800 Subject: [PATCH] feat: set --- src/worktable.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/worktable.rs b/src/worktable.rs index 3ed08b6..b26d6c0 100644 --- a/src/worktable.rs +++ b/src/worktable.rs @@ -426,6 +426,14 @@ impl<'a> RowViewMut<'a> { .unwrap() } #[allow(private_bounds)] + pub fn set(&mut self, field: T, value: T::Type) + where + T: WorkTableField, + for<'b> &'b mut T::Type: From>, + { + *self.index_mut(field) = value; + } + #[allow(private_bounds)] pub fn get_mut(&mut self, column: &str) -> Option<&mut T> where for<'b> &'b mut T: From>,