pub struct SessionCache {
pub session_id: String,
pub query_hash: String,
pub block_identifiers: HashSet<String>,
}Expand description
Structure to hold cache data for a session
Fields§
§session_id: StringSession identifier
query_hash: StringQuery hash for this cache
block_identifiers: HashSet<String>Set of block identifiers that have been seen in this session Format: “file.rs:23-45” (file path with start-end line numbers)
Implementations§
Source§impl SessionCache
impl SessionCache
Sourcepub fn new(session_id: String, query_hash: String) -> Self
pub fn new(session_id: String, query_hash: String) -> Self
Create a new session cache with the given ID and query hash
Sourcepub fn add_to_cache(&mut self, block_id: String)
pub fn add_to_cache(&mut self, block_id: String)
Add a block identifier to the cache
Sourcepub fn get_cache_path(session_id: &str, query_hash: &str) -> PathBuf
pub fn get_cache_path(session_id: &str, query_hash: &str) -> PathBuf
Get the path to the cache file
Trait Implementations§
Source§impl Debug for SessionCache
impl Debug for SessionCache
Source§impl<'de> Deserialize<'de> for SessionCache
impl<'de> Deserialize<'de> for SessionCache
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§
impl Freeze for SessionCache
impl RefUnwindSafe for SessionCache
impl Send for SessionCache
impl Sync for SessionCache
impl Unpin for SessionCache
impl UnwindSafe for SessionCache
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more