| 469 | } |
| 470 | |
| 471 | pub fn policy_summary(&self) -> String { |
| 472 | self.profile.as_ref().map_or_else( |
| 473 | || "no profile".to_string(), |
| 474 | |profile| { |
| 475 | let endpoints = profile.endpoints.len(); |
| 476 | let binaries = profile.binaries.len(); |
| 477 | let mut summary = format!( |
| 478 | "{endpoints} endpoint{}, {binaries} bin{}", |
| 479 | plural(endpoints), |
| 480 | plural(binaries) |
| 481 | ); |
| 482 | if profile.inference_capable { |
| 483 | summary.push_str(", inference"); |
| 484 | } |
| 485 | summary |
| 486 | }, |
| 487 | ) |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | // --------------------------------------------------------------------------- |