Struct sequoia_wot::QueryBuilder
source · pub struct QueryBuilder<'a, S>where
S: Store,{ /* private fields */ }
Expand description
A builder for the parameters for a query on a network.
A QueryBuilder
can be used to create a Query
progressively.
Implementations§
source§impl<'a, S> QueryBuilder<'a, S>where
S: Store,
impl<'a, S> QueryBuilder<'a, S>where
S: Store,
sourcepub fn new(network: &'a Network<S>) -> Self
pub fn new(network: &'a Network<S>) -> Self
Returns a new QueryBuilder
.
Returns a QueryBuilder
that takes a reference to a
Network
. This constructor makes it easy to have multiple
QueryBuilder
s or Query
s that use the same network, and
consequently share a cache.
A QueryBuilder
can also own the Network
. In that case,
use QueryBuilder::new_owned
to create the QueryBuilder
.
sourcepub fn new_owned(network: Arc<Network<S>>) -> Self
pub fn new_owned(network: Arc<Network<S>>) -> Self
Returns a new QueryBuilder
.
Returns a QueryBuilder
that takes ownership (in the form of
an Arc
) of a Network
. This variant is useful when the
QueryBuilder
or Query
should own the network. Because
this takes an Arc
, it is still possible for multiple
Query
s to share a cache.
A QueryBuilder
can also just reference the Network
. In
that case, use QueryBuilder::new
to create the
QueryBuilder
.
sourcepub fn certification_network(&mut self) -> &mut Self
pub fn certification_network(&mut self) -> &mut Self
Configures the Query
to treat the network as a certification
network.
By default, a Query
works with an authentication network.
In a certification network, all certifications are considered
to be trusted signatures with an infinite trust depth, and no
regular expressions.
This is how most so-called web-of-trust path-finder or pgp path-finder algorithms work: they are interested in determining whether there is a chain of certifications from one certificate to another without regard as to whether a certifier considers the target to be a trusted introducer, or to have only verified the target’s identity.
sourcepub fn authentication_network(&mut self) -> &mut Self
pub fn authentication_network(&mut self) -> &mut Self
Configures the Query
to treat the network as an
authentication network.
This is the default mode of operation where plain
certifications are only considered certifications, and the
target is not considered to be a trusted introducer. An
alternative mode of operation is a certification network.
This can be configured using Query::certification_network
.
See that method’s documentation for more details.
sourcepub fn maximum_depth(&mut self, limit: usize) -> &mut Self
pub fn maximum_depth(&mut self, limit: usize) -> &mut Self
Limits all trusted introducers to the given maximum depth.
Note: With the depth limited to 0
, the maximum lengths of
paths will be two, with the paths containing the certifier and
the target).