Clamp a client-provided page `limit`. Returns `default` when `raw` is 0 (the protobuf zero-value convention), otherwise returns the smaller of `raw` and `max`.
(raw: u32, default: u32, max: u32)
| 69 | /// Returns `default` when `raw` is 0 (the protobuf zero-value convention), |
| 70 | /// otherwise returns the smaller of `raw` and `max`. |
| 71 | pub fn clamp_limit(raw: u32, default: u32, max: u32) -> u32 { |
| 72 | if raw == 0 { default } else { raw.min(max) } |
| 73 | } |
| 74 | |
| 75 | /// Map a `PersistenceError` to an appropriate gRPC `Status`. |
| 76 | /// |
no outgoing calls
no test coverage detected