[][src]Trait pour::ConsCtx

pub trait ConsCtx<K: RadixKey, V: Clone> {
    fn cons_arc(&mut self, inner: &Arc<InnerMap<K, V>>) -> Arc<InnerMap<K, V>>;
fn cons(&mut self, inner: InnerMap<K, V>) -> Arc<InnerMap<K, V>>; fn cons_recursive(
        &mut self,
        inner: &Arc<InnerMap<K, V>>
    ) -> Arc<InnerMap<K, V>> { ... } }

A trait implemented by objects which can perform hash-consing on a map's internal data

Required methods

fn cons_arc(&mut self, inner: &Arc<InnerMap<K, V>>) -> Arc<InnerMap<K, V>>

Return an Arc<InnerMap> with the same contents as the provided Arc

Correctness

The resulting Arc should compare equal to inner if they are comparable. If not, being the result of clone is fine.

fn cons(&mut self, inner: InnerMap<K, V>) -> Arc<InnerMap<K, V>>

Return an Arc<InnerMap> with the same contents as the provided object.

Correctness

The resulting Arc should compare equal to inner if they are comparable. If not, being the result of new is fine.

Loading content...

Provided methods

fn cons_recursive(&mut self, inner: &Arc<InnerMap<K, V>>) -> Arc<InnerMap<K, V>>

Return an Arc<InnerMap> with the same contents as the provided Arc

Note: this is provided as a separate function from cons_arc to allow the user the choice as to whether to perform deep or shallow hash-consing of mutated values: if shallow hash-consing is desired, this method should just clone the input Arc, whereas if deep hash-consing is desired, this method should return another, potentially hash-consed Arc. Deep hash-consing is the default, so cons_arc is called by the default implementation.

Correctness

The resulting Arc should compare equal to inner if they are comparable. If not, being the result of clone is fine.

Loading content...

Implementations on Foreign Types

impl<K: RadixKey, V: Clone> ConsCtx<K, V> for ()[src]

Loading content...

Implementors

impl<K: RadixKey + Eq + Hash, V: Clone + Eq + Hash, S: BuildHasher> ConsCtx<K, V> for MapCtx<K, V, S>[src]

Loading content...