(&self, serializer: S)
| 228 | |
| 229 | impl Serialize for Deploy { |
| 230 | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> |
| 231 | where |
| 232 | S: serde::Serializer, |
| 233 | { |
| 234 | use serde::ser::SerializeStruct; |
| 235 | |
| 236 | let len = self.manifest_path.is_some() as usize |
| 237 | + self.lambda_dir.is_some() as usize |
| 238 | + self.binary_path.is_some() as usize |
| 239 | + self.binary_name.is_some() as usize |
| 240 | + self.s3_bucket.is_some() as usize |
| 241 | + self.s3_key.is_some() as usize |
| 242 | + self.extension as usize |
| 243 | + self.internal as usize |
| 244 | + self.compatible_runtimes.is_some() as usize |
| 245 | + self.output_format.is_some() as usize |
| 246 | + self.tag.is_some() as usize |
| 247 | + self.include.is_some() as usize |
| 248 | + self.dry as usize |
| 249 | + self.merge_env as usize |
| 250 | + self.name.is_some() as usize |
| 251 | + self.remote_config.as_ref().map_or(0, |r| r.count_fields()) |
| 252 | + self.function_config.count_fields(); |
| 253 | |
| 254 | let mut state = serializer.serialize_struct("Deploy", len)?; |
| 255 | |
| 256 | if let Some(ref path) = self.manifest_path { |
| 257 | state.serialize_field("manifest_path", path)?; |
| 258 | } |
| 259 | if let Some(ref dir) = self.lambda_dir { |
| 260 | state.serialize_field("lambda_dir", dir)?; |
| 261 | } |
| 262 | if let Some(ref path) = self.binary_path { |
| 263 | state.serialize_field("binary_path", path)?; |
| 264 | } |
| 265 | if let Some(ref name) = self.binary_name { |
| 266 | state.serialize_field("binary_name", name)?; |
| 267 | } |
| 268 | if let Some(ref bucket) = self.s3_bucket { |
| 269 | state.serialize_field("s3_bucket", bucket)?; |
| 270 | } |
| 271 | if let Some(ref key) = self.s3_key { |
| 272 | state.serialize_field("s3_key", key)?; |
| 273 | } |
| 274 | if self.extension { |
| 275 | state.serialize_field("extension", &self.extension)?; |
| 276 | } |
| 277 | if self.internal { |
| 278 | state.serialize_field("internal", &self.internal)?; |
| 279 | } |
| 280 | if let Some(ref runtimes) = self.compatible_runtimes { |
| 281 | state.serialize_field("compatible_runtimes", runtimes)?; |
| 282 | } |
| 283 | if let Some(ref format) = self.output_format { |
| 284 | state.serialize_field("output_format", format)?; |
| 285 | } |
| 286 | if let Some(ref tag) = self.tag { |
| 287 | state.serialize_field("tag", tag)?; |
nothing calls this directly
no test coverage detected