Skip to main content

TrustStoreBuilder

Struct TrustStoreBuilder 

Source
pub struct TrustStoreBuilder
where TrustStoreSettings: Describe,
{ /* private fields */ }
Expand description

Builds a TrustStore from its settings, filled in layers, and the inputs it takes. build lists everything still missing at once.

Implementations§

Source§

impl TrustStoreBuilder
where Self: Holds<TrustStoreSettings>,

Source

pub fn waiting(self, value: impl Into<WaitingSettings>) -> Self

The waiting queue: its limits, how sources are grouped and what a full source does.

Source

pub fn rotation(self, value: impl Into<RotationOptions>) -> Self

How an accepted peer’s key is replaced by its successor.

Source§

impl TrustStoreBuilder
where TrustStoreSettings: Describe,

Source

pub fn state_dir(self, value: impl Into<PathBuf>) -> Self

Sets the input state_dir; the last call wins.

Source

pub fn clock(self, value: impl Into<Clock>) -> Self

Sets the input clock; the last call wins.

Source

pub fn fill(self, partial: Partial<TrustStoreSettings>) -> Self

Lays partial over what is set: only the keys it sets are taken, and the last write of a key wins.

Source

pub fn fill_from(self, source: &mut impl Source) -> Result<Self, FillError>

Fills the settings from source, in turn after what is already set. The keys the source holds that the settings lack are dropped; to see them, fill a Partial and pass it to fill.

§Errors

The FillError that Partial::fill_from gives.

Source

pub fn parts(self) -> Result<TrustStoreParts, Missing>

The parts: the settings built, every required input present and every optional input as given. A second terminal (one that builds a different value from the same parts) is written over this.

§Errors

Everything that is missing, at once: the same Missing that build gives.

Source

pub fn build( self, ) -> Result<TrustStore, BuildError<<TrustStore as TryFrom<TrustStoreParts>>::Error>>

The built value, or everything that is missing: every required setting and every required input, at once.

§Errors

What is missing, or for a fallible build the error of the conversion.

Source§

impl TrustStoreBuilder
where TrustStoreSettings: Describe,

Source

pub fn non_defaults(&self) -> Vec<NonDefault>

Every setting that differs from its default, as the builder would build it.

Source§

impl TrustStoreBuilder

Source

pub fn limits(self, limits: WaitingLimits) -> Self

The bounds on the waiting queue. Default 16 per source, 1000 in all, 60 seconds.

Source

pub fn ipv6_prefix(self, bits: u8) -> Self

Group IPv6 sources by their first bits bits for the per-source limits. Default 64. 128 counts each address alone, which lets the holder of a subnet fill the queue; values above 128 are 128. IPv4 sources, IPv4-mapped IPv6 ones included, always count per address.

Source

pub fn when_full(self, when_full: WhenFull) -> Self

What a newcomer to a full source gets. Default WhenFull::Refuse, so that strangers sharing a source cannot flush those already waiting.

Source

pub fn record_interval(self, interval: Duration) -> Self

Record a new peer from one source at most once per interval, each record being a synced write a stranger can cause. Default one second; zero is no limit.

Trait Implementations§

Source§

impl Check<TrustStoreBuilder> for Profile
where TrustStoreSettings: Describe,

Source§

fn check(&self, subject: &TrustStoreBuilder, report: &mut Report)

Judges subject, pushing a Finding per expectation.
Source§

impl Configured for TrustStoreBuilder
where TrustStoreSettings: Describe,

Source§

type Settings = TrustStoreSettings

The type of the settings.
Source§

fn configured(&self) -> &dyn Inspect

The settings, read through [Inspect].
§

fn non_defaults(&self) -> Vec<NonDefault>

Every setting that differs from its default.
Source§

impl Debug for TrustStoreBuilder
where TrustStoreSettings: Describe,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Partial<TrustStoreSettings>> for TrustStoreBuilder
where TrustStoreSettings: Describe,

Source§

fn from(partial: Partial<TrustStoreSettings>) -> Self

Converts to this type from the input type.
Source§

impl Holds<TrustStoreSettings> for TrustStoreBuilder
where TrustStoreSettings: Describe,

Source§

fn partial_mut(&mut self) -> &mut Partial<TrustStoreSettings>

The settings being filled.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<__B> TrustStoreSettingsSetters for __B
where __B: Holds<TrustStoreSettings>,

Source§

fn waiting(self, value: impl Into<WaitingSettings>) -> __B

The waiting queue: its limits, how sources are grouped and what a full source does.
Source§

fn rotation(self, value: impl Into<RotationOptions>) -> __B

How an accepted peer’s key is replaced by its successor.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.