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