pub struct ArtifactStore<A> { /* private fields */ }Expand description
The compiled artifacts of one backend and device, kept by kernel and, for a
backend that opts in, by the source each was finalized from — see
ArtifactCompiler::source.
Holds nothing when compilation caching is disabled or the target has nowhere durable to put it: every take then misses and every keep refuses.
Implementations§
Source§impl<A: StoreValue> ArtifactStore<A>
impl<A: StoreValue> ArtifactStore<A>
Sourcepub fn new(backend: &'static str, fingerprint: impl AsRef<str>) -> Self
pub fn new(backend: &'static str, fingerprint: impl AsRef<str>) -> Self
The artifacts backend compiled for fingerprint, kept by kernel
only. See compilation_store for what the two name.
Sourcepub fn with_sources(names: StoreNames, fingerprint: impl AsRef<str>) -> Self
pub fn with_sources(names: StoreNames, fingerprint: impl AsRef<str>) -> Self
The artifacts compiled for fingerprint, kept by kernel and by
source, each map under its name in names.
Sourcepub fn persists(&self) -> bool
pub fn persists(&self) -> bool
Whether anything is kept between runs, which is what binds a backend’s loaded kernels to the active environment.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether the compilation store is enabled for this backend.
Sourcepub fn take(&mut self, kernel: &KernelId) -> Option<A>
pub fn take(&mut self, kernel: &KernelId) -> Option<A>
Takes the artifact kept for kernel out of the store, to be loaded.
Sourcepub fn take_variant<V: Hash>(&mut self, id: &ArtifactId<V>) -> Option<A>
pub fn take_variant<V: Hash>(&mut self, id: &ArtifactId<V>) -> Option<A>
Takes the artifact kept for id (kernel and variant) out of the store, to be loaded.
Sourcepub fn store_variant<V: Hash>(
&mut self,
id: &ArtifactId<V>,
artifact: A,
) -> bool
pub fn store_variant<V: Hash>( &mut self, id: &ArtifactId<V>, artifact: A, ) -> bool
Stores artifact under id (kernel and variant).
Sourcepub fn purge_variant<V: Hash>(&mut self, id: &ArtifactId<V>)
pub fn purge_variant<V: Hash>(&mut self, id: &ArtifactId<V>)
Purges a corrupted or invalid entry for id (kernel and variant).
Sourcepub fn take_by_source(&mut self, source: &str) -> Option<A>
pub fn take_by_source(&mut self, source: &str) -> Option<A>
The artifact another kernel finalized from source, for
keep to put under the kernel asking.
A kernel of this build keeps its own entry: it is as live as the one asking, and two kernel ids of one build that expand to one source — several of them in one batch — each keep theirs. One of an earlier build is moved, deleted under its key: nothing will ask for that key again.
Trait Implementations§
Auto Trait Implementations§
impl<A> !RefUnwindSafe for ArtifactStore<A>
impl<A> !Sync for ArtifactStore<A>
impl<A> !UnwindSafe for ArtifactStore<A>
impl<A> Freeze for ArtifactStore<A>
impl<A> Send for ArtifactStore<A>
impl<A> Unpin for ArtifactStore<A>
impl<A> UnsafeUnpin for ArtifactStore<A>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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