Skip to main content

RefResolver

Trait RefResolver 

Source
pub trait RefResolver {
    // Required methods
    fn ref_for_value(&mut self, cx: &mut Cx, value: &Value) -> Result<Ref>;
    fn resolve_ref(&self, cx: &mut Cx, reference: &Ref) -> Result<ResolvedRef>;
}
Expand description

Contract for assigning references to values and resolving them back.

This is protocol the libraries implement; the kernel defines the trait and a TemporaryRefResolver, not the durable resolution policy.

Required Methods§

Source

fn ref_for_value(&mut self, cx: &mut Cx, value: &Value) -> Result<Ref>

Returns a stable Ref for value, interning it if needed.

Source

fn resolve_ref(&self, cx: &mut Cx, reference: &Ref) -> Result<ResolvedRef>

Resolves reference to a ResolvedRef under the current context.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§