pub struct DeployerCache { /* private fields */ }Expand description
Deployer records keyed by their bytecode meta hash.
The key here is not a digest of the value - a deployer is keyed by its
bytecode meta hash while carrying a constructor meta of its own - so the
invariant is internal: meta_bytes must hash to meta_hash. A record that
gets that wrong describes a deployer whose constructor meta is not the meta
it names, and crate::meta::Store copies exactly those bytes into the
MetaCache under exactly that hash.
Same shape as MetaCache, for the same reason: the check was a convention
spread across call sites, and set_deployer and
set_deployer_from_query_response both missed it.
rainlanguage/rain.metadata#170.
Implementations§
Source§impl DeployerCache
impl DeployerCache
Sourcepub fn insert_verified(
&mut self,
key: &[u8],
deployer: NPE2Deployer,
) -> Result<&NPE2Deployer, Error>
pub fn insert_verified( &mut self, key: &[u8], deployer: NPE2Deployer, ) -> Result<&NPE2Deployer, Error>
Caches deployer under key, and only if its own meta bytes hash to
the meta hash it claims for them.
Sourcepub fn get(&self, key: &[u8]) -> Option<&NPE2Deployer>
pub fn get(&self, key: &[u8]) -> Option<&NPE2Deployer>
The deployer cached under key, if any.
Sourcepub fn contains_key(&self, key: &[u8]) -> bool
pub fn contains_key(&self, key: &[u8]) -> bool
Whether anything is cached under key.
Trait Implementations§
Source§impl Clone for DeployerCache
impl Clone for DeployerCache
Source§fn clone(&self) -> DeployerCache
fn clone(&self) -> DeployerCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeployerCache
impl Debug for DeployerCache
Source§impl Default for DeployerCache
impl Default for DeployerCache
Source§fn default() -> DeployerCache
fn default() -> DeployerCache
Source§impl<'de> Deserialize<'de> for DeployerCache
Deserializing is a way in, so it goes through the gate, as for MetaCache.
impl<'de> Deserialize<'de> for DeployerCache
Deserializing is a way in, so it goes through the gate, as for MetaCache.
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl PartialEq for DeployerCache
impl PartialEq for DeployerCache
Source§impl Serialize for DeployerCache
impl Serialize for DeployerCache
impl StructuralPartialEq for DeployerCache
Auto Trait Implementations§
impl Freeze for DeployerCache
impl RefUnwindSafe for DeployerCache
impl Send for DeployerCache
impl Sync for DeployerCache
impl Unpin for DeployerCache
impl UnsafeUnpin for DeployerCache
impl UnwindSafe for DeployerCache
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<'de, T> BorrowedRpcObject<'de> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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