forked from github-starred/komodo
execute basically working, still need to clear the response channel upon completion
This commit is contained in:
5
lib/cache/src/lib.rs
vendored
5
lib/cache/src/lib.rs
vendored
@@ -81,6 +81,11 @@ impl<K: PartialEq + Eq + Hash + std::fmt::Debug + Clone, T: Clone>
|
||||
self.cache.read().await.get(key).cloned()
|
||||
}
|
||||
|
||||
pub async fn get_keys(&self) -> Vec<K> {
|
||||
let cache = self.cache.read().await;
|
||||
cache.keys().cloned().collect()
|
||||
}
|
||||
|
||||
pub async fn get_values(&self) -> Vec<T> {
|
||||
let cache = self.cache.read().await;
|
||||
cache.values().cloned().collect()
|
||||
|
||||
@@ -66,11 +66,11 @@ pub fn data_from_transport_bytes(
|
||||
/// incoming transport bytes.
|
||||
pub fn from_transport_bytes(
|
||||
bytes: Bytes,
|
||||
) -> anyhow::Result<(Uuid, MessageState, Bytes)> {
|
||||
) -> anyhow::Result<(Bytes, Uuid, MessageState)> {
|
||||
let (id, state) = id_state_from_transport_bytes(&bytes)?;
|
||||
let mut res: Vec<u8> = bytes.into();
|
||||
res.drain((res.len() - 17)..);
|
||||
Ok((id, state, res.into()))
|
||||
Ok((res.into(), id, state))
|
||||
}
|
||||
|
||||
impl MessageState {
|
||||
|
||||
Reference in New Issue
Block a user