Add setters to Update
@@ -32,6 +32,22 @@ pub struct Update {
pub kind: UpdateKind,
}
+impl Update {
+ pub fn new(id: i32, kind: UpdateKind) -> Self {
+ Self { id, kind }
+ }
+
+ pub fn id<S>(mut self, val: i32) -> Self {
+ self.id = val;
+ self
+ }
+
+ pub fn kind<S>(mut self, val: UpdateKind) -> Self {
+ self.kind = val;
+ self
+ }
+}
+
impl Update {
/// Tries to parse `value` into `Update`, logging an error if failed.
///
