pub struct NetworkBuilder<S>where
S: Store,{ /* private fields */ }
Expand description
A builder for Network
s, which can be used to configure the
properties of the network.
A NetworkBuilder
is used to create a specially configured
Network
.
Implementations§
Source§impl<S> NetworkBuilder<S>where
S: Store,
impl<S> NetworkBuilder<S>where
S: Store,
Sourcepub fn rooted<R>(store: S, roots: R) -> Self
pub fn rooted<R>(store: S, roots: R) -> Self
Returns a new NetworkBuilder
.
Returns a NetworkBuilder
with the specified root.
By default, the NetworkBuilder
is configured to be an
authentication network, and there is no maximum depth.
Sourcepub fn rootless(store: S) -> Self
pub fn rootless(store: S) -> Self
Returns a new NetworkBuilder
.
Returns a NetworkBuilder
without any roots. This is still
useful for querying specific paths.
By default, the NetworkBuilder
is configured to be an
authentication network, and there is no maximum depth.
Sourcepub fn certification_network(self) -> Self
pub fn certification_network(self) -> Self
Configures the Network
to be a certification network.
By default, a Network
is treated as 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(self) -> Self
pub fn authentication_network(self) -> Self
Configures the Network
to be 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
NetworkBuilder::certification_network
. See that method’s
documentation for more details.
Sourcepub fn maximum_depth(self, limit: usize) -> Self
pub fn maximum_depth(self, limit: usize) -> 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).