Skip to main content

ProcessorBuilder

Struct ProcessorBuilder 

Source
pub struct ProcessorBuilder { /* private fields */ }
Expand description

ProcessorBuilder is used to initialize a Processor instance.

Implementations§

Source§

impl ProcessorBuilder

Source

pub fn from_serialized(config: &str) -> Result<Self>

initialize a ProcessorBuilder with a serialized ProcessorConfig.

Source

pub fn from_config(config: &ProcessorConfig) -> Result<Self>

initialize a ProcessorBuilder with a ProcessorConfig.

Source

pub fn announce_services(self, offer: ServiceOffer) -> Self

Announce offer through DNS relays: the processor publishes this node’s service descriptor on every heartbeat of the offer (#1049).

Source

pub fn receive_mail(self, offer: MailOffer) -> Self

Take mail at did@domain through mail gateways (#1117): the processor publishes this node’s mail descriptor, which names its delegatee key, on every heartbeat of offer.

Source

pub fn register_task(self, task: Arc<dyn RegistrationTask>) -> Self

Attach an external periodic DHT RegistrationTask so the processor publishes its lease descriptor on every heartbeat and on the first admitted edge (#855, #918).

Source

pub fn observer(self, observer: SharedSwarmObserver) -> Self

Chain observer after the processor’s own Observability, an open hook for embedders to observe the swarm’s message and lookup activity. SwarmBuilder::observer offers the same for a bare swarm.

Contract:

  • Synchronous and bounded. The observer is called synchronously on the send and receive paths, so it must not block, wait or do slow work; see SwarmObserver.
  • After the processor’s recorder. It runs after the processor’s own Observability, which alone feeds /status?view=observability, so installing an observer leaves that status output unchanged.
  • Bounded data. Message observations carry no payload, key or identifier: only the activity, the scheduling category, the compile-time message class and the outcome. Lookup events carry a correlation key (a transaction id or a resource DID) so start and finish can be paired; an exporter must aggregate or redact it, never use it as a label.
  • One extra observer. A later call replaces the observer set by an earlier one.
Source

pub fn storage(self, storage: EntryStorage) -> Self

Set the storage for the processor.

Source

pub fn relay_storage(self, storage: EntryStorage) -> Self

Set the storage of the relay-inbox namespace (SwarmBuilder::relay_storage): a RecordAuthority::Retained store, so held mail survives a crash and is never evicted (#1021). Without one, the node takes custody of no relay carrier.

Source

pub fn removal_storage(self, storage: RemovalStorage) -> Self

Set the storage of the data namespace’s remove sides (SwarmBuilder::removal_storage): a RecordAuthority::Retained store, so a remove survives a crash and is never evicted before it is stable (#920). Without one, the remove sides are kept in memory.

Source

pub fn relay_replication(self, replication: RelayReplication) -> Self

Set how relay custody is replicated (#777): the members r each carrier is replicated to, and how long the node is online before it holds relay mail. By default r is 8 and the age gate is 2 minutes, raised to four stabilization periods when those are longer (Law (Age gate) of durable-records); a value set here is taken as given.

Source

pub fn replay_storage(self, storage: ReplayStorage) -> Self

Set durable destination-scoped transaction replay storage: an authoritative store. Without one, the processor refuses every replay transition, so it neither sends nor accepts a transaction (SwarmBuilder::replay_storage, #1022).

Source

pub fn origin_quota(self, config: OriginQuotaConfig) -> Self

Set final-destination per-origin message and byte-rate quotas.

Source

pub fn onion_entry_guard_storage(self, storage: OnionEntryGuardStorage) -> Self

Set the local entry-guard storage for onion route selection.

Source

pub fn measure(self, implement: PeriodicMeasure) -> Self

Set the measure for the processor.

Source

pub fn stores_released(self, released: StoresReleased) -> Self

Name the release witnesses of the file stores this processor is built over, which Provider::close awaits (#1085). A store given to the builder without its witness is not awaited by a close.

Source

pub fn dht_finger_table_size(self, size: usize) -> Self

Set the number of DHT finger-table slots for the processor’s swarm.

Source

pub fn dht_virtual_nodes(self, positions_per_peer: u16) -> Self

Set storage-only virtual positions derived per physical peer.

Serialized configs reject values above rings_core::dht::MAX_STORAGE_VIRTUAL_POSITIONS_PER_OWNER. This builder setter is infallible for direct programmatic use; the core swarm builder normalizes the value once before storage ownership and protocol advertisement are created.

Source

pub fn reassembly_limits(self, limits: ReassemblyLimits) -> Self

Set inbound chunk reassembly limits for the processor’s swarm.

Source

pub fn online_node_type(self, node_type: OnlineNodeType) -> Self

Set the runtime family advertised in the online-node registry.

Source

pub fn advertise_presence(self, advertise: bool) -> Self

Set whether listen() advertises this node’s presence.

Source

pub fn onion_idle_floor(self, floor: OnionIdleFloor) -> Self

Set the cover floor of this node’s idle onion links (#880); the default is one unit per second, and a constrained node (a browser) may lower it.

Source

pub fn onion_udp_bind_config(self, config: OnionUdpBindConfig) -> Self

Configure OS UDP socket binding and peer-IP admission for onion::udp exit sessions.

Source

pub fn onion_role(self, role: OnionRole<OnionExitOffer>) -> Self

Set the onion symbols this process registers (#834 D2).

Source

pub const fn configured_onion_role(&self) -> &OnionRole<OnionExitOffer>

Return the onion symbols currently configured on this builder.

Source

pub fn onion_process_epoch(self, epoch: OnionProcessEpoch) -> Self

Override the initial onion process epoch instead of drawing one from the builder’s RNG.

Source

pub fn clock(self, clock: SharedClock) -> Self

Inject a custom SharedClock capability for deterministic protocol and session time.

Source

pub fn rng(self, rng: SharedRng) -> Self

Inject a custom SharedRng capability for deterministic protocol and session randomness.

Source

pub fn network_parameters<P>(self, params: P) -> Self
where P: NodeNetworkParameters + 'static,

Inject custom NodeNetworkParameters to customize the processor’s transport (#1291).

Source

pub fn remote_rpc_proxy(self, proxy: RemoteRpcProxy) -> Self

Route native remote JSON-RPC requests (nodeDid, answerOffer, acceptAnswer) through proxy instead of connecting directly.

Source

pub fn build(self) -> Result<Processor>

Build the Processor.

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

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

Source§

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

Source§

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

Source§

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + 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, 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.
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