Files

26 lines
506 B
Rust
Raw Permalink Normal View History

2026-01-09 00:28:43 +09:00
// Copyright 2018-2026 the Deno authors. MIT license.
2024-04-17 07:19:55 -07:00
use deno_core::ModuleSpecifier;
2024-11-18 15:09:28 -05:00
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
2024-04-17 07:19:55 -07:00
pub enum CodeCacheType {
EsModule,
Script,
}
pub trait CodeCache: Send + Sync {
fn get_sync(
&self,
specifier: &ModuleSpecifier,
2024-04-17 07:19:55 -07:00
code_cache_type: CodeCacheType,
source_hash: u64,
2024-04-17 07:19:55 -07:00
) -> Option<Vec<u8>>;
2024-11-18 15:09:28 -05:00
2024-04-17 07:19:55 -07:00
fn set_sync(
&self,
specifier: ModuleSpecifier,
2024-04-17 07:19:55 -07:00
code_cache_type: CodeCacheType,
source_hash: u64,
2024-04-17 07:19:55 -07:00
data: &[u8],
);
}