pub struct CodeFileCache;Expand description
针对用的代码,进行检测和缓存
Implementations§
Source§impl CodeFileCache
impl CodeFileCache
Sourcepub fn obtain_code_hash(code: &str) -> String
pub fn obtain_code_hash(code: &str) -> String
检查代码文件缓存
Sourcepub async fn check_code_file_cache_exisht(
hash: &str,
language: &LanguageScript,
) -> bool
pub async fn check_code_file_cache_exisht( hash: &str, language: &LanguageScript, ) -> bool
根据代码的hash检查是否存在缓存
Sourcepub async fn get_code_file_cache(
hash: &str,
language: &LanguageScript,
) -> Result<(File, PathBuf)>
pub async fn get_code_file_cache( hash: &str, language: &LanguageScript, ) -> Result<(File, PathBuf)>
获取代码文件缓存
Sourcepub async fn save_code_file_cache(
hash: &str,
code: &str,
language: &LanguageScript,
) -> Result<(File, PathBuf)>
pub async fn save_code_file_cache( hash: &str, code: &str, language: &LanguageScript, ) -> Result<(File, PathBuf)>
保存代码文件缓存
Sourcepub async fn clear_cache_by_language(language: &LanguageScript) -> Result<()>
pub async fn clear_cache_by_language(language: &LanguageScript) -> Result<()>
清除指定语言的缓存文件
Sourcepub async fn clear_all_cache() -> Result<()>
pub async fn clear_all_cache() -> Result<()>
清除所有缓存文件
Auto Trait Implementations§
impl Freeze for CodeFileCache
impl RefUnwindSafe for CodeFileCache
impl Send for CodeFileCache
impl Sync for CodeFileCache
impl Unpin for CodeFileCache
impl UnwindSafe for CodeFileCache
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