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,

source

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 QueryBuilders or Querys 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.

source

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 Querys to share a cache.

A QueryBuilder can also just reference the Network. In that case, use QueryBuilder::new to create the QueryBuilder.

source

pub fn network(&self) -> &Network<S>

Returns a reference to the network.

source

pub fn roots<R>(&mut self, roots: R) -> &mut Self
where R: Into<Roots>,

Sets the trust roots.

source

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.

source

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.

source

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

source

pub fn build(&self) -> Query<'a, S>

Returns a Query.

Auto Trait Implementations§

§

impl<'a, S> RefUnwindSafe for QueryBuilder<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for QueryBuilder<'a, S>
where S: Sync + Send,

§

impl<'a, S> Sync for QueryBuilder<'a, S>
where S: Sync + Send,

§

impl<'a, S> Unpin for QueryBuilder<'a, S>

§

impl<'a, S> UnwindSafe for QueryBuilder<'a, S>
where S: RefUnwindSafe,

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more