Struct NetworkBuilder

Source
pub struct NetworkBuilder<S>
where S: Store,
{ /* private fields */ }
Expand description

A builder for Networks, 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,

Source

pub fn rooted<R>(store: S, roots: R) -> Self
where R: Into<Roots>,

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub fn build(self) -> Network<S>

Returns a Network.

Auto Trait Implementations§

§

impl<S> Freeze for NetworkBuilder<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for NetworkBuilder<S>
where S: RefUnwindSafe,

§

impl<S> Send for NetworkBuilder<S>
where S: Send,

§

impl<S> Sync for NetworkBuilder<S>
where S: Sync,

§

impl<S> Unpin for NetworkBuilder<S>
where S: Unpin,

§

impl<S> UnwindSafe for NetworkBuilder<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,