(bytes: Option<&'a pb::VersionedBytes>, schema: &str)
| 60 | } |
| 61 | |
| 62 | fn payload<'a>(bytes: Option<&'a pb::VersionedBytes>, schema: &str) -> Result<&'a [u8], String> { |
| 63 | let bytes = bytes.ok_or_else(|| format!("missing {schema} payload"))?; |
| 64 | if bytes.schema != schema { |
| 65 | return Err(format!("expected {schema}, got '{}'", bytes.schema)); |
| 66 | } |
| 67 | Ok(&bytes.payload) |
| 68 | } |
| 69 | |
| 70 | /// A view as the handlers name it. |
| 71 | pub fn view_ref(name: &str) -> pb::ViewRef { |
no outgoing calls
no test coverage detected