#[non_exhaustive]pub enum SharedCacheResp<V = CachedAnswer> {
Hit {
value: V,
score: f32,
embedding: Vec<f32>,
},
Miss {
best: Option<f32>,
},
Stored,
Removed {
count: u64,
},
Exact {
value: Option<Vec<u8>>,
},
Pong {
entries: u64,
},
Error {
message: String,
},
}Expand description
The answer to a SharedCacheReq.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Hit
A Lookup reached the threshold. embedding is the stored
entry’s (normalized), so the asker can keep a local copy under the same direction.
Miss
A Lookup found nothing at the threshold; best is the best
score below it.
Stored
An insert or exact put was taken (a store may still drop it at any time).
Removed
A removal; count entries went.
Exact
An ExactGet.
Pong
A Ping; entries is the node’s semantic entry count.
Error
The node refused or couldn’t serve the request (bad input, no exact store, not authorized, an unknown request from a newer version).
Implementations§
Sourcepub fn encode(&self) -> Result<Vec<u8>, RemoteError>
pub fn encode(&self) -> Result<Vec<u8>, RemoteError>
CBOR, with the WIRE_VERSION.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, RemoteError>
pub fn decode(bytes: &[u8]) -> Result<Self, RemoteError>
From encode, like SharedCacheReq::decode.
Trait Implementations§
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more