(id: Uuid)
| 89 | } |
| 90 | |
| 91 | pub async fn get(id: Uuid) -> Result<internal::PassiveRoamingDeviceSession, Error> { |
| 92 | let key = redis_key(format!("pr:sess:{{{}}}", id)); |
| 93 | |
| 94 | let v: Vec<u8> = redis::cmd("GET") |
| 95 | .arg(key) |
| 96 | .query_async(&mut get_async_redis_conn().await?) |
| 97 | .await |
| 98 | .context("Get passive-roaming device-session")?; |
| 99 | if v.is_empty() { |
| 100 | return Err(Error::NotFound(id.to_string())); |
| 101 | } |
| 102 | let ds = internal::PassiveRoamingDeviceSession::decode(&mut Cursor::new(v)) |
| 103 | .context("Decode passive-roaming device-session")?; |
| 104 | Ok(ds) |
| 105 | } |
| 106 | |
| 107 | pub async fn delete(id: Uuid) -> Result<()> { |
| 108 | let key = redis_key(format!("pr:sess:{{{}}}", id)); |
no test coverage detected