fn encode_bindings<'b>(
        &'b self,
        variables: &'b [Variable],
        iter: BindingsIterator<'b>,
    ) -> EncodedTuplesIterator<'b>
    where
        'a: 'b,
    {
        let (binding_variables, iter) = BindingsIterator::destruct(iter);
        let mut combined_variables = variables.to_vec();
        for v in binding_variables.clone() {
            if !combined_variables.contains(&v) {
                combined_variables.resize(combined_variables.len() + 1, v);
            }
        }
        Box::new(iter.map(move |terms| {
            let mut encoder = self.dataset.encoder();
            let mut encoded_terms = vec![None; combined_variables.len()];
            for (i, term_option) in terms?.into_iter().enumerate() {
                match term_option {
                    None => (),
                    Some(term) => {
                        if let Ok(encoded) = encoder.encode_term(&term) {
                            let variable = binding_variables[i].clone();
                            put_variable_value(
                                &variable,
                                &combined_variables,
                                encoded,
                                &mut encoded_terms,
                            )
                        }
                    }
                }
            }
            Ok(encoded_terms)
        }))
    }
// this is used to encode results froma BindingIterator into an EncodedTuplesIterator. This happens when SERVICE clauses are evaluated
this is used to encode results froma BindingIterator into an EncodedTuplesIterator. This happens when SERVICE clauses are evaluated
this is used to encode results froma BindingIterator into an EncodedTuplesIterator . This happens when SERVICE clauses are evaluated
fn encode_bindings<'b>(
        &'b self,
        variables: &'b [Variable],
        iter: BindingsIterator<'b>,
    ) -> EncodedTuplesIterator<'b>
    where
        'a: 'b,
    {
        let (binding_variables, iter) = BindingsIterator::destruct(iter);
        let mut combined_variables = variables.to_vec();
        for v in binding_variables.clone() {
            if !combined_variables.contains(&v) {
                combined_variables.resize(combined_variables.len() + 1, v);
            }
        }
        Box::new(iter.map(move |terms| {
            let mut encoder = self.dataset.encoder();
            let mut encoded_terms = vec![None; combined_variables.len()];
            for (i, term_option) in terms?.into_iter().enumerate() {
                match term_option {
                    None => (),
                    Some(term) => {
                        if let Ok(encoded) = encoder.encode_term(&term) {
                            let variable = binding_variables[i].clone();
                            put_variable_value(
                                &variable,
                                &combined_variables,
                                encoded,
                                &mut encoded_terms,
                            )
                        }
                    }
                }
            }
            Ok(encoded_terms)
        }))
    }
fn encode_bindings < ' b > ( & ' b self , variables : & ' b [ Variable ] , iter : BindingsIterator < ' b > , ) -> EncodedTuplesIterator < ' b > where ' a : ' b , { let ( binding_variables , iter ) = BindingsIterator :: destruct ( iter ) ; let mut combined_variables = variables . to_vec ( ) ; for v in binding_variables . clone ( ) { if ! combined_variables . contains ( & v ) { combined_variables . resize ( combined_variables . len ( ) + 1 , v ) ; } } Box :: new ( iter . map ( move | terms | { let mut encoder = self . dataset . encoder ( ) ; let mut encoded_terms = vec ! [ None combined_variables len ( ) ] ; for ( i , term_option ) in terms ? . into_iter ( ) . enumerate ( ) { match term_option { None => ( ) , Some ( term ) => { if let Ok ( encoded ) = encoder . encode_term ( & term ) { let variable = binding_variables [ i ] . clone ( ) ; put_variable_value ( & variable , & combined_variables , encoded , & mut encoded_terms , ) } } } } Ok ( encoded_terms ) } ) ) }
this is used to encode results froma BindingIterator into an EncodedTuplesIterator.
this is used to encode results froma BindingIterator into an EncodedTuplesIterator .
&'b self
variables
&'b [Variable]
iter
BindingsIterator<'b>
&'b self
variables
&'b [Variable]
iter
BindingsIterator<'b>