pub struct ProcessorBuilder { /* private fields */ }Expand description
ProcessorBuilder is used to initialize a Processor instance.
Implementations§
Source§impl ProcessorBuilder
impl ProcessorBuilder
Sourcepub fn from_serialized(config: &str) -> Result<Self>
pub fn from_serialized(config: &str) -> Result<Self>
initialize a ProcessorBuilder with a serialized ProcessorConfig.
Sourcepub fn from_config(config: &ProcessorConfig) -> Result<Self>
pub fn from_config(config: &ProcessorConfig) -> Result<Self>
initialize a ProcessorBuilder with a ProcessorConfig.
Sourcepub fn announce_services(self, offer: ServiceOffer) -> Self
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).
Sourcepub fn receive_mail(self, offer: MailOffer) -> Self
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.
Sourcepub fn register_task(self, task: Arc<dyn RegistrationTask>) -> Self
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).
Sourcepub fn observer(self, observer: SharedSwarmObserver) -> Self
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.
Sourcepub fn storage(self, storage: EntryStorage) -> Self
pub fn storage(self, storage: EntryStorage) -> Self
Set the storage for the processor.
Sourcepub fn relay_storage(self, storage: EntryStorage) -> Self
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.
Sourcepub fn removal_storage(self, storage: RemovalStorage) -> Self
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.
Sourcepub fn relay_replication(self, replication: RelayReplication) -> Self
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.
Sourcepub fn replay_storage(self, storage: ReplayStorage) -> Self
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).
Sourcepub fn origin_quota(self, config: OriginQuotaConfig) -> Self
pub fn origin_quota(self, config: OriginQuotaConfig) -> Self
Set final-destination per-origin message and byte-rate quotas.
Sourcepub fn onion_entry_guard_storage(self, storage: OnionEntryGuardStorage) -> Self
pub fn onion_entry_guard_storage(self, storage: OnionEntryGuardStorage) -> Self
Set the local entry-guard storage for onion route selection.
Sourcepub fn measure(self, implement: PeriodicMeasure) -> Self
pub fn measure(self, implement: PeriodicMeasure) -> Self
Set the measure for the processor.
Sourcepub fn stores_released(self, released: StoresReleased) -> Self
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.
Sourcepub fn dht_finger_table_size(self, size: usize) -> Self
pub fn dht_finger_table_size(self, size: usize) -> Self
Set the number of DHT finger-table slots for the processor’s swarm.
Sourcepub fn dht_virtual_nodes(self, positions_per_peer: u16) -> Self
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.
Sourcepub fn reassembly_limits(self, limits: ReassemblyLimits) -> Self
pub fn reassembly_limits(self, limits: ReassemblyLimits) -> Self
Set inbound chunk reassembly limits for the processor’s swarm.
Sourcepub fn online_node_type(self, node_type: OnlineNodeType) -> Self
pub fn online_node_type(self, node_type: OnlineNodeType) -> Self
Set the runtime family advertised in the online-node registry.
Sourcepub fn advertise_presence(self, advertise: bool) -> Self
pub fn advertise_presence(self, advertise: bool) -> Self
Set whether listen() advertises this node’s presence.
Sourcepub fn onion_idle_floor(self, floor: OnionIdleFloor) -> Self
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.
Sourcepub fn onion_udp_bind_config(self, config: OnionUdpBindConfig) -> Self
pub fn onion_udp_bind_config(self, config: OnionUdpBindConfig) -> Self
Configure OS UDP socket binding and peer-IP admission for onion::udp exit sessions.
Sourcepub fn onion_role(self, role: OnionRole<OnionExitOffer>) -> Self
pub fn onion_role(self, role: OnionRole<OnionExitOffer>) -> Self
Set the onion symbols this process registers (#834 D2).
Sourcepub const fn configured_onion_role(&self) -> &OnionRole<OnionExitOffer>
pub const fn configured_onion_role(&self) -> &OnionRole<OnionExitOffer>
Return the onion symbols currently configured on this builder.
Sourcepub fn onion_process_epoch(self, epoch: OnionProcessEpoch) -> Self
pub fn onion_process_epoch(self, epoch: OnionProcessEpoch) -> Self
Override the initial onion process epoch instead of drawing one from the builder’s RNG.
Sourcepub fn clock(self, clock: SharedClock) -> Self
pub fn clock(self, clock: SharedClock) -> Self
Inject a custom SharedClock capability for deterministic protocol and session time.
Sourcepub fn rng(self, rng: SharedRng) -> Self
pub fn rng(self, rng: SharedRng) -> Self
Inject a custom SharedRng capability for deterministic protocol and session randomness.
Sourcepub fn network_parameters<P>(self, params: P) -> Selfwhere
P: NodeNetworkParameters + 'static,
pub fn network_parameters<P>(self, params: P) -> Selfwhere
P: NodeNetworkParameters + 'static,
Inject custom NodeNetworkParameters to customize the processor’s transport (#1291).
Sourcepub fn remote_rpc_proxy(self, proxy: RemoteRpcProxy) -> Self
pub fn remote_rpc_proxy(self, proxy: RemoteRpcProxy) -> Self
Route native remote JSON-RPC requests (nodeDid, answerOffer, acceptAnswer) through
proxy instead of connecting directly.
Auto Trait Implementations§
impl !RefUnwindSafe for ProcessorBuilder
impl !UnwindSafe for ProcessorBuilder
impl Forget for ProcessorBuilder
impl Freeze for ProcessorBuilder
impl Move for ProcessorBuilder
impl Send for ProcessorBuilder
impl Sync for ProcessorBuilder
impl Unpin for ProcessorBuilder
impl UnsafeUnpin for ProcessorBuilder
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.