pub struct ComponentStore { /* private fields */ }

Implementations§

Arguments
  • max_size: max size in bytes of the components being cached
Examples found in repository?
src/runtime.rs (line 157)
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
    pub(crate) fn prepare_component_call(
        &mut self,
        key: &ComponentKey,
        req_bytes: usize,
    ) -> RuntimeResult<Instance> {
        let module = if let Some(module) = self.component_modules.get(key) {
            module
        } else {
            let contract = self
                .component_store
                .fetch_component(key)
                .ok_or_else(|| RuntimeInnerError::ComponentNotFound(key.clone()))?;
            let module = Module::new(&self.wasm_store, contract.as_ref())?;
            self.component_modules.insert(key.clone(), module);
            self.component_modules.get(key).unwrap()
        }
        .clone();
        let instance = self.prepare_instance(&module)?;
        self.set_instance_mem(req_bytes, &instance)?;
        Ok(instance)
    }
Examples found in repository?
src/component.rs (line 251)
243
244
245
246
247
248
249
250
251
252
    fn register_component(
        &mut self,
        component: Component<'_>,
        cipher: XChaCha20Poly1305,
        nonce: XNonce,
    ) -> RuntimeResult<()> {
        self.secret_store
            .register_component(component.key().clone(), cipher, nonce)?;
        self.component_store.store_component(component)
    }
Examples found in repository?
src/component.rs (line 256)
255
256
257
    fn unregister_component(&mut self, key: &ComponentKey) -> RuntimeResult<()> {
        self.component_store.remove_component(key)
    }

Trait Implementations§

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type for metadata in pointers and references to Self.
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
upcast ref
upcast mut ref
upcast boxed dyn
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more