Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 21 fields pub server: Option<ServerSection>, pub zone: Option<ZoneSection>, pub dns: Option<DnsSection>, pub tls: Option<TlsSection>, pub blobs: Option<BlobsSection>, pub capacity: Option<CapacitySection>, pub pool: Option<Vec<PoolSection>>, pub names: Option<NamesSection>, pub park: Option<ParkSection>, pub tree: Option<TreeSection>, pub oidc: Option<OidcSection>, pub sessions: Option<SessionsSection>, pub credential: Option<CredentialSection>, pub intervals: Option<IntervalsSection>, pub disclosure: Option<DisclosureSection>, pub operator: Option<OperatorSection>, pub oauth: Option<OAuthSection>, pub policy: Option<PolicySection>, pub relay: Option<RelaySection>, pub writes: Option<WritesSection>, pub proxy: Option<ProxySection>,
}
Expand description

The whole file, one optional table per section.

A section an operator has not written is a section this binary decides on its own, the same as a flag nobody passed — so every field here is Option, and an empty file parses to a Config of every section absent rather than an error.

Fields§

§server: Option<ServerSection>

[server] — bind address, port.

§zone: Option<ZoneSection>

[zone] — the zones accounts are minted under, and who answers for them.

§dns: Option<DnsSection>

[dns] — provider selection and its zone.

§tls: Option<TlsSection>

[tls] — ACME environment, contact, certificate source.

§blobs: Option<BlobsSection>

[blobs] — max size, the per-account and total quotas, retention window.

§capacity: Option<CapacitySection>

[capacity] — how many accounts this deployment may hold.

§pool: Option<Vec<PoolSection>>

[[pool]] — named sources of names: which zones and labels each holds, and how it makes a name.

§names: Option<NamesSection>

[names] — the naming spec, its fallback, the number encoding and the hold period.

§park: Option<ParkSection>

[park] — how bot.did.parkKey holds a key.

§tree: Option<TreeSection>

[tree] — the shape one creator may give the ownership tree.

§oidc: Option<OidcSection>

[oidc] — which issuers’ tokens are accepted, and how fresh.

§sessions: Option<SessionsSection>

[sessions] — sessions minted from a proof.

§credential: Option<CredentialSection>

[credential] — how long the agent token provisioning mints lasts.

§intervals: Option<IntervalsSection>

[intervals] — how often each background loop runs.

§disclosure: Option<DisclosureSection>

[disclosure] — which bot.did.* routes this run has closed.

§operator: Option<OperatorSection>

[operator] — the operator sign-in’s session lifetime, and the grace window an unreachable operator gets.

§oauth: Option<OAuthSection>

[oauth] — the scope ceiling, the pending-decision bounds, and the resolver permission sets are found through.

§policy: Option<PolicySection>

[policy] — which DID’s records to read as policy.

§relay: Option<RelaySection>

[relay] — which relays an operator’s announce reaches.

§writes: Option<WritesSection>

[writes] — how fast one account may write.

§proxy: Option<ProxySection>

[proxy] — what one account may spend of atproto-proxy.

Implementations§

Source§

impl Config

Source

pub fn load(path: &Path) -> Result<Config, ConfigError>

Reads and parses a configuration file, naming the path in any error.

Source

pub fn parse(text: &str) -> Result<Config, Error>

Parses configuration text directly, for a caller that already has it (or a test that would rather not touch a filesystem).

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Config

Source§

impl StructuralPartialEq for Config

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,