Skip to main content

RuntimeInputs

Struct RuntimeInputs 

Source
pub struct RuntimeInputs {
    pub channel: ChannelIdentity,
    pub channel_id: ChannelId,
    pub self_node_id: NodeId,
    pub replica_set: Vec<NodeId>,
    pub heartbeat_ms: u64,
    pub wall_clock_provider: Arc<dyn Fn() -> u64 + Send + Sync>,
    pub tail_provider: Arc<dyn Fn() -> u64 + Send + Sync>,
    pub rtt_lookup: RttLookup,
    pub file: RedexFile,
    pub default_bandwidth_class: BandwidthClass,
    pub background_fraction: f32,
}
Expand description

Inputs the runtime task captures at spawn time. The tail_provider closure reads the current RedexFile::next_seq() — passed as a closure so the runtime doesn’t take ownership of the file handle (the file’s owner is Redex).

Fields§

§channel: ChannelIdentity

Channel identity + origin_hash.

§channel_id: ChannelId

32-byte BLAKE2s channel id for the wire-format heartbeat.

§self_node_id: NodeId

This node’s id.

§replica_set: Vec<NodeId>

Replica-set membership — every node currently registered as a replica for the channel. Coordinator updates this when the placement filter re-selects (Phase C / F).

§heartbeat_ms: u64

Heartbeat cadence in milliseconds (mirrors ReplicationConfig::heartbeat_ms). The tokio interval drives at this cadence.

§wall_clock_provider: Arc<dyn Fn() -> u64 + Send + Sync>

Function returning the wall-clock milliseconds for the outbound heartbeat’s wall_clock_ms field. Operator- facing drift detection only; abstracted so tests can inject a deterministic value.

§tail_provider: Arc<dyn Fn() -> u64 + Send + Sync>

Function returning the current local tail_seq. Called each tick before emission so heartbeats carry the freshest value.

§rtt_lookup: RttLookup

RTT lookup for the election function.

§file: RedexFile

The local RedexFile for this channel. The runtime holds a clone (RedexFile is Clone — Arc-backed) so it can drive handle_sync_request on inbound SyncRequest frames (leader path) and apply_sync_response on inbound SyncResponse frames (replica path). The tail_provider closure typically wraps file.next_seq().

§default_bandwidth_class: BandwidthClass

Per-channel default super::bandwidth::BandwidthClass — stamped on every SyncRequest the runtime emits. v0.3 Phase D2. Sourced from ReplicationConfig::default_bandwidth_class.

§background_fraction: f32

v0.3 Phase D2 admission-gate parameter: fraction of the bandwidth bucket capacity reserved against Background. Default 0.3 via ReplicationConfig::background_fraction.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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