mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
30 lines
831 B
Rust
30 lines
831 B
Rust
use std::sync::Arc;
|
|
|
|
use aquatic_common::access_list::AccessListArcSwap;
|
|
use aquatic_common::CanonicalSocketAddr;
|
|
|
|
pub use aquatic_common::ValidUntil;
|
|
|
|
#[derive(Default, Clone)]
|
|
pub struct State {
|
|
pub access_list: Arc<AccessListArcSwap>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug)]
|
|
pub struct PendingScrapeId(pub usize);
|
|
|
|
#[derive(Copy, Clone, Debug)]
|
|
pub struct ConsumerId(pub usize);
|
|
|
|
#[derive(Clone, Copy, Debug)]
|
|
pub struct ConnectionId(pub usize);
|
|
|
|
#[derive(Clone, Copy, Debug)]
|
|
pub struct ConnectionMeta {
|
|
/// Index of socket worker responsible for this connection. Required for
|
|
/// sending back response through correct channel to correct worker.
|
|
pub out_message_consumer_id: ConsumerId,
|
|
pub connection_id: ConnectionId,
|
|
pub peer_addr: CanonicalSocketAddr,
|
|
pub pending_scrape_id: Option<PendingScrapeId>,
|
|
}
|