DaemonState

Struct DaemonState 

Source
pub struct DaemonState {
    pub identity: Identity,
    pub services: RwLock<ServiceRegistry>,
    pub network_state: Arc<RwLock<NetworkState>>,
    pub networks: RwLock<Vec<String>>,
    pub net_tx: Sender<NetworkCommand>,
    pub storage_managers: StorageManagerMap,
    pub qos: Arc<RwLock<QosRegistry>>,
    pub outgoing_assignments: OutgoingAssignments,
    pub remote_fragment_index: Arc<RwLock<RemoteFragmentIndex>>,
    pub chunk_cek_hints: RwLock<HashMap<String, [u8; 32]>>,
    pub reputation: RwLock<ReputationStore>,
    pub file_registry: RwLock<FileRegistry>,
}
Expand description

Shared daemon state accessible from the control server.

Fields§

§identity: Identity§services: RwLock<ServiceRegistry>§network_state: Arc<RwLock<NetworkState>>§networks: RwLock<Vec<String>>§net_tx: Sender<NetworkCommand>§storage_managers: StorageManagerMap

One StorageManager per active Pouch service, keyed by service_id.

Shared with the network loop so incoming fragment-fetch requests can be served directly from the P2P event handler.

§qos: Arc<RwLock<QosRegistry>>

Per-peer QoS data updated by the network quality monitor. Used by PutFile to derive adaptive k/n from live stability scores.

§outgoing_assignments: OutgoingAssignments

Tracks which fragments were pushed to which remote Pouch peer.

Updated by the network loop on every PushFragment; read by the quality monitor to select Proof-of-Storage challenge targets.

§remote_fragment_index: Arc<RwLock<RemoteFragmentIndex>>

In-memory index of chunk_id → [(peer_id, fragment_id)] learned from gossipped FragmentIndexAnnouncements.

Populated when received from the network; used by GetFile to issue targeted FetchChunkFragments requests instead of broadcasting to all known Pouches.

§chunk_cek_hints: RwLock<HashMap<String, [u8; 32]>>

Maps chunk_id → BLAKE3(plaintext_chunk) so that GetFile can re-derive the per-user CEK for decryption after RLNC decode.

Populated by PutFile; persisted only for the daemon’s lifetime (lost on restart — full persistence comes with the manifest system).

§reputation: RwLock<ReputationStore>

Per-peer reputation state (tier R0–R4, score, uptime, PoS pass rate).

Updated by the quality monitor and by eviction events.

§file_registry: RwLock<FileRegistry>

Local catalogue of files uploaded by this node’s Bill services.

Populated on each successful PutFile. Persisted to file_registry.json.

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.

§

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

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