pub fn query<'r, R: Readable>(
        &'r self,
        r: &'r R,
        from: Option<Timestamp>,
        to: Option<Timestamp>,
        dht_arc: Option<DhtArc>,
    ) -> DatabaseResult<
        Box<
            dyn FallibleIterator<Item = (DhtOpHash, IntegratedDhtOpsValue), Error = DatabaseError>
                + 'r,
        >,
    > {
        Ok(Box::new(
            self.store
                .iter(r)?
                .map(move |(k, v)| Ok((DhtOpHash::from_raw_39_panicky(k.to_vec()), v)))
                .filter_map(move |(k, v)| match from {
                    Some(time) if v.when_integrated >= time => Ok(Some((k, v))),
                    None => Ok(Some((k, v))),
                    _ => Ok(None),
                })
                .filter_map(move |(k, v)| match to {
                    Some(time) if v.when_integrated < time => Ok(Some((k, v))),
                    None => Ok(Some((k, v))),
                    _ => Ok(None),
                })
                .filter_map(move |(k, v)| match dht_arc {
                    Some(dht_arc) if dht_arc.contains(v.op.dht_basis().get_loc()) => {
                        Ok(Some((k, v)))
                    }
                    None => Ok(Some((k, v))),
                    _ => Ok(None),
                }),
        ))
    }
/// Get ops that match optional queries:
/// - from a time (Inclusive)
/// - to a time (Exclusive)
/// - match a dht location
Get ops that match optional queries:
from a time (Inclusive)
to a time (Exclusive)
match a dht location
Get ops that match optional queries : from a time ( Inclusive ) to a time ( Exclusive ) match a dht location
pub fn query<'r, R: Readable>(
        &'r self,
        r: &'r R,
        from: Option<Timestamp>,
        to: Option<Timestamp>,
        dht_arc: Option<DhtArc>,
    ) -> DatabaseResult<
        Box<
            dyn FallibleIterator<Item = (DhtOpHash, IntegratedDhtOpsValue), Error = DatabaseError>
                + 'r,
        >,
    > {
        Ok(Box::new(
            self.store
                .iter(r)?
                .map(move |(k, v)| Ok((DhtOpHash::from_raw_39_panicky(k.to_vec()), v)))
                .filter_map(move |(k, v)| match from {
                    Some(time) if v.when_integrated >= time => Ok(Some((k, v))),
                    None => Ok(Some((k, v))),
                    _ => Ok(None),
                })
                .filter_map(move |(k, v)| match to {
                    Some(time) if v.when_integrated < time => Ok(Some((k, v))),
                    None => Ok(Some((k, v))),
                    _ => Ok(None),
                })
                .filter_map(move |(k, v)| match dht_arc {
                    Some(dht_arc) if dht_arc.contains(v.op.dht_basis().get_loc()) => {
                        Ok(Some((k, v)))
                    }
                    None => Ok(Some((k, v))),
                    _ => Ok(None),
                }),
        ))
    }
pub fn query < ' r , R : Readable > ( & ' r self , r : & ' r R , from : Option < Timestamp > , to : Option < Timestamp > , dht_arc : Option < DhtArc > , ) -> DatabaseResult < Box < dyn FallibleIterator < Item = ( DhtOpHash , IntegratedDhtOpsValue ) , Error = DatabaseError > + ' r , > , > { Ok ( Box :: new ( self . store . iter ( r ) ? . map ( move | ( k , v ) | Ok ( ( DhtOpHash :: from_raw_39_panicky ( k . to_vec ( ) ) , v ) ) ) . filter_map ( move | ( k , v ) | match from { Some ( time ) if v . when_integrated >= time => Ok ( Some ( ( k , v ) ) ) , None => Ok ( Some ( ( k , v ) ) ) , _ => Ok ( None ) , } ) . filter_map ( move | ( k , v ) | match to { Some ( time ) if v . when_integrated < time => Ok ( Some ( ( k , v ) ) ) , None => Ok ( Some ( ( k , v ) ) ) , _ => Ok ( None ) , } ) . filter_map ( move | ( k , v ) | match dht_arc { Some ( dht_arc ) if dht_arc . contains ( v . op . dht_basis ( ) . get_loc ( ) ) => { Ok ( Some ( ( k , v ) ) ) } None => Ok ( Some ( ( k , v ) ) ) , _ => Ok ( None ) , } ) , ) ) }
Get ops that match optional queries:
 from a time (Inclusive)
 to a time (Exclusive)
 match a dht location
Get ops that match optional queries : from a time ( Inclusive ) to a time ( Exclusive ) match a dht location
&'r self
r
&'r R
from
Option<Timestamp>
to
Option<Timestamp>
dht_arc
Option<DhtArc>
&'r self
r
&'r R
from
Option<Timestamp>
to
Option<Timestamp>
dht_arc
Option<DhtArc>