Fetch and decode a protobuf message by name.
(
&self,
name: &str,
)
| 380 | |
| 381 | /// Fetch and decode a protobuf message by name. |
| 382 | pub async fn get_message_by_name<T: Message + Default + ObjectType + SetResourceVersion>( |
| 383 | &self, |
| 384 | name: &str, |
| 385 | ) -> PersistenceResult<Option<T>> { |
| 386 | self.get_by_name(T::object_type(), name) |
| 387 | .await? |
| 388 | .map(decode_record) |
| 389 | .transpose() |
| 390 | } |
| 391 | |
| 392 | /// List and decode protobuf messages, hydrating `resource_version` from |
| 393 | /// the authoritative DB row (mirrors `get_message`). |
no test coverage detected