/// Persist temporary values that the datoms may reference the heap.
///
/// Values that come from the input query (whether read-only or write) are
/// stored as temporaries. When an assertion produces datoms that have
/// tempoaries as values, these datoms cannot be inserted directly. The
/// temporaries must first be persisted on the heap, and the values in the
/// datoms must be updated to reference the new stable offsets.
Persist temporary values that the datoms may reference the heap.
Values that come from the input query (whether read-only or write) are
stored as temporaries. When an assertion produces datoms that have
tempoaries as values, these datoms cannot be inserted directly. The
temporaries must first be persisted on the heap, and the values in the
datoms must be updated to reference the new stable offsets.
Persist temporary values that the datoms may reference the heap . Values that come from the input query ( whether read - only or write ) are stored as temporaries . When an assertion produces datoms that have tempoaries as values these datoms cannot be inserted directly . The temporaries must first be persisted on the heap and the values in the datoms must be updated to reference the new stable offsets .
fn persist_temporaries(
        &mut self,
        temporaries: &Temporaries,
        datoms: &mut [Datom],
    ) -> io::Result<()>
    where Heap: heap::HeapMut {
        for datom in datoms.iter_mut() {
            let value = datom.value;
            if value.is_temporary() {
                let value_fin = match () {
                    _ if value.is_u64() => {
                        let cid_tmp = value.as_const_u64();
                        let data = temporaries.get_u64(cid_tmp);
                        let cid_fin = self.heap.append_u64(data)?;
                        Value::from_const_u64(cid_fin)
                    }
                    _ if value.is_bytes() => {
                        let cid_tmp = value.as_const_bytes();
                        let data = temporaries.get_bytes(cid_tmp);
                        let cid_fin = self.heap.append_bytes(data)?;
                        Value::from_const_bytes(cid_fin)
                    }
                    _ => unreachable!("Value is either u64 or bytes."),
                };
                datom.value = value_fin;
            }
        }
        Ok(())
    }
fn persist_temporaries ( & mut self , temporaries : & Temporaries , datoms : & mut [ Datom ] , ) -> io :: Result < ( ) > where Heap : heap :: HeapMut { for datom in datoms . iter_mut ( ) { let value = datom . value ; if value . is_temporary ( ) { let value_fin = match ( ) { _ if value . is_u64 ( ) => { let cid_tmp = value . as_const_u64 ( ) ; let data = temporaries . get_u64 ( cid_tmp ) ; let cid_fin = self . heap . append_u64 ( data ) ? ; Value :: from_const_u64 ( cid_fin ) } _ if value . is_bytes ( ) => { let cid_tmp = value . as_const_bytes ( ) ; let data = temporaries . get_bytes ( cid_tmp ) ; let cid_fin = self . heap . append_bytes ( data ) ? ; Value :: from_const_bytes ( cid_fin ) } _ => unreachable ! ( " " ) , } ; datom . value = value_fin ; } } Ok ( ( ) ) }
Persist temporary values that the datoms may reference the heap.
Persist temporary values that the datoms may reference the heap .
&mut self
temporaries
&Temporaries
datoms
&mut [Datom]