pub struct FederationConfigBuilder<T: Clone> { /* private fields */ }
Expand description

Builder for FederationConfig.

Implementations§

source§

impl<T: Clone + Clone> FederationConfigBuilder<T>

source

pub fn domain<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

The domain where this federated instance is running

source

pub fn app_data(&mut self, value: T) -> &mut Self

Data which the application requires in handlers, such as database connection or configuration.

source

pub fn http_fetch_limit(&mut self, value: u32) -> &mut Self

Maximum number of outgoing HTTP requests per incoming HTTP request. See crate::fetch::object_id::ObjectId for more details.

source

pub fn client(&mut self, value: ClientWithMiddleware) -> &mut Self

HTTP client used for all outgoing requests. Middleware can be used to add functionality like log tracing or retry of failed requests.

source

pub fn debug(&mut self, value: bool) -> &mut Self

Run library in debug mode. This allows usage of http and localhost urls. It also sends outgoing activities synchronously, not in background thread. This helps to make tests more consistent. Do not use for production.

source

pub fn allow_http_urls(&mut self, value: bool) -> &mut Self

Allow HTTP urls even in production mode

source

pub fn request_timeout(&mut self, value: Duration) -> &mut Self

Timeout for all HTTP requests. HTTP signatures are valid for 10s, so it makes sense to use the same as timeout when sending

source

pub fn url_verifier(&mut self, value: Box<dyn UrlVerifier + Sync>) -> &mut Self

Function used to verify that urls are valid, See UrlVerifier for details.

source

pub fn http_signature_compat(&mut self, value: bool) -> &mut Self

Enable to sign HTTP signatures according to draft 10, which does not include (created) and (expires) fields. This is required for compatibility with some software like Pleroma. https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-10 https://git.pleroma.social/pleroma/pleroma/-/issues/2939

source

pub fn queue_worker_count(&mut self, value: usize) -> &mut Self

When sending with activity queue: Number of tasks that can be in-flight concurrently. Tasks are retried once after a minute, then put into the retry queue. Setting this count to 0 means that there is no limit to concurrency

source

pub fn queue_retry_count(&mut self, value: usize) -> &mut Self

When sending with activity queue: Number of concurrent tasks that are being retried in-flight concurrently. Tasks are retried after an hour, then again in 60 hours. Setting this count to 0 means that there is no limit to concurrency

source§

impl<T: Clone> FederationConfigBuilder<T>

source

pub fn signed_fetch_actor<A: Actor>(&mut self, actor: &A) -> &mut Self

Sets an actor to use to sign all federated fetch requests

source

pub fn actor_pkey_cache(&mut self, cache_size: u64) -> &mut Self

sets the number of parsed actor private keys to keep in memory

source

pub async fn build( &mut self ) -> Result<FederationConfig<T>, FederationConfigBuilderError>

Constructs a new config instance with the values supplied to builder.

Values which are not explicitly specified use the defaults. Also initializes the queue for outgoing activities, which is stored internally in the config struct. Requires a tokio runtime for the background queue.

Trait Implementations§

source§

impl<T: Clone + Clone> Clone for FederationConfigBuilder<T>

source§

fn clone(&self) -> FederationConfigBuilder<T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T: Clone + Clone> Default for FederationConfigBuilder<T>

source§

fn default() -> Self

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

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

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn from_ref(input: &T) -> T

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

impl<T> Instrument for T

source§

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

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

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

source§

const ALIGN: usize = _

The alignment of pointer.
§

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

§

type Output = T

Should always be Self
source§

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

§

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

§

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

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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