message: StructGen implement serde Serializable
diff: @@ -46,6 +46,7 @@ use gazebo::{
  any::AnyLifetime,
  coerce::{coerce_ref, Coerce},
  };
  +use serde::{ser::SerializeMap, Serialize};
  use crate::{
  self as starlark,
  @@ -236,6 +237,23 @@ where
  }
  }
  +impl<'v, V: ValueLike<'v>> Serialize for StructGen<'v, V>
  +where
  + Self: AnyLifetime<'v>,
  +{
  + fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  + where
  + S: serde::Serializer,
  + {
  + let mut map_serialize = serializer.serialize_map(Some(self.fields.len()))?;
  + for (k, v) in self.fields.iter() {
  + map_serialize.serialize_entry(k.to_string_value().as_str(), &v.to_value())?;
  + }
  +
  + map_serialize.end()
  + }
  +}
  +
  /// Like [`ValueOf`](crate::values::ValueOf), but only validates value types; does not construct
  /// or store a map.
  pub struct StructOf<'v, V: UnpackValue<'v>> {
  