pub struct GlobalHttpCache<Env: DenoCacheEnv> { /* private fields */ }

Implementations§

source§

impl<Env: DenoCacheEnv> GlobalHttpCache<Env>

source

pub fn new(path: PathBuf, env: Env) -> Self

source

pub fn get_global_cache_location(&self) -> &PathBuf

source

pub fn get_global_cache_filepath(&self, url: &Url) -> Result<PathBuf, AnyError>

Trait Implementations§

source§

impl<Env: Debug + DenoCacheEnv> Debug for GlobalHttpCache<Env>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Env: DenoCacheEnv> HttpCache for GlobalHttpCache<Env>

source§

fn cache_item_key<'a>( &self, url: &'a Url ) -> Result<HttpCacheItemKey<'a>, AnyError>

A pre-computed key for looking up items in the cache.
source§

fn contains(&self, url: &Url) -> bool

source§

fn read_modified_time( &self, key: &HttpCacheItemKey<'_> ) -> Result<Option<SystemTime>, AnyError>

source§

fn set( &self, url: &Url, headers: HashMap<String, String>, content: &[u8] ) -> Result<(), AnyError>

source§

fn read_file_bytes( &self, key: &HttpCacheItemKey<'_> ) -> Result<Option<Vec<u8>>, AnyError>

source§

fn read_metadata( &self, key: &HttpCacheItemKey<'_> ) -> Result<Option<CachedUrlMetadata>, AnyError>

Auto Trait Implementations§

§

impl<Env> RefUnwindSafe for GlobalHttpCache<Env>where Env: RefUnwindSafe,

§

impl<Env> Send for GlobalHttpCache<Env>

§

impl<Env> Sync for GlobalHttpCache<Env>

§

impl<Env> Unpin for GlobalHttpCache<Env>where Env: Unpin,

§

impl<Env> UnwindSafe for GlobalHttpCache<Env>where Env: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.