pub struct AsyncLineCache {
pub cache: Arc<DashMap<String, String>>,
pub file_times: Arc<DashMap<String, SystemTime>>,
pub file_lines: Arc<DashMap<String, Vec<String>>>,
}Fields§
§cache: Arc<DashMap<String, String>>§file_times: Arc<DashMap<String, SystemTime>>§file_lines: Arc<DashMap<String, Vec<String>>>Implementations§
Source§impl AsyncLineCache
impl AsyncLineCache
pub fn new() -> Self
pub async fn get_line( &self, filename: &str, lineno: usize, ) -> Result<Option<String>>
pub async fn get_lines(&self, filename: &str) -> Result<Option<Vec<String>>>
pub async fn random_line(&self, filename: &str) -> Result<Option<String>>
pub async fn clear_cache(&self)
Auto Trait Implementations§
impl Freeze for AsyncLineCache
impl !RefUnwindSafe for AsyncLineCache
impl Send for AsyncLineCache
impl Sync for AsyncLineCache
impl Unpin for AsyncLineCache
impl !UnwindSafe for AsyncLineCache
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