Skip to main content

ProxySettings

Struct ProxySettings 

Source
pub struct ProxySettings {
    pub calls_per_minute: u32,
    pub burst_calls: u32,
    pub in_flight_per_account: usize,
    pub in_flight_per_tree: usize,
    pub in_flight_total: usize,
    pub target_cache_ttl: Duration,
    pub target_cache_entries: usize,
    pub app_view: Option<String>,
}
Expand description

The bounds on proxied calls, and where an app.bsky.* call with no atproto-proxy goes; see ProxyLimits.

Fields§

§calls_per_minute: u32

How many proxied calls one account’s budget refills by each minute.

Reasonable range: 1 to 6000. Sixty, the default, is one a second sustained: a hundred times the few calls a minute an agent makes, and the most one account can make a third party see from this server’s address.

§burst_calls: u32

How many proxied calls one account may make at once from a full budget.

Reasonable range: 1 to 1000. Sixty, the default, covers a client that opens a view by fanning out a few dozen calls.

§in_flight_per_account: usize

How many of one account’s proxied calls may be open at once, from the request to the last byte of the answer.

Reasonable range: 1 to 64. Eight, the default, is more than an agent opens at once, and keeps one account to a sixteenth of in_flight_total.

§in_flight_per_tree: usize

How many proxied calls may be open at once across one account tree: an account this server’s operator admitted, and every account created beneath it.

Reasonable range: 1 to 512. 64, the default, is half of in_flight_total, so one creator’s accounts leave half for every other tree. A per-tree cap at or above in_flight_total has no effect.

§in_flight_total: usize

How many proxied calls may be open at once across every account.

Reasonable range: 1 to 512. 128, the default, is a quarter of crate::MAX_CONCURRENT_REQUESTS, so however many accounts call a stalled service, three quarters of the request permits stay free for everything else. A per-account cap above it has no effect.

§target_cache_ttl: Duration

How long the endpoint a target’s DID document names is kept.

Reasonable range: 10 to 3600 seconds. Five minutes, the default, fetches a document once for every few hundred calls an agent makes to it, and a service that moves is reached at its new address within five minutes.

§target_cache_entries: usize

How many targets’ endpoints are kept, the least recently used dropped first.

Reasonable range: 16 to 100_000. An entry is a few kilobytes at most. 1024, the default, holds every service a deployment’s agents call in common use, in a few megabytes.

§app_view: Option<String>

The service an app.bsky.* call with no atproto-proxy header is sent to, as that header would name it: did#service, such as did:web:api.bsky.app#bsky_appview. The reference PDS sends these calls to its configured app view the same way.

None, the default, sends nowhere: such a call is MethodNotImplemented.

Implementations§

Source§

impl ProxySettings

Source

pub fn check(&self) -> Result<(), String>

Refuses a setting outside its documented range, or an app_view that is not a DID and a service id, naming its [proxy] key.

Trait Implementations§

Source§

impl Clone for ProxySettings

Source§

fn clone(&self) -> ProxySettings

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 ProxySettings

Source§

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

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

impl Default for ProxySettings

Source§

fn default() -> Self

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

impl PartialEq for ProxySettings

Source§

fn eq(&self, other: &ProxySettings) -> 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 Eq for ProxySettings

Source§

impl StructuralPartialEq for ProxySettings

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,