da9d743f39
* axum-equivalent mixnode http api routes * replaced all rocket routes with axum equivalents * removed '_axum' suffix from the routes
26 lines
704 B
Rust
26 lines
704 B
Rust
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use crate::node::http::verloc::VerlocState;
|
|
use crate::node::node_statistics::SharedNodeStats;
|
|
use axum::extract::FromRef;
|
|
|
|
// this is a temporary thing for the transition period
|
|
#[derive(Clone)]
|
|
pub(crate) struct MixnodeAppState {
|
|
pub(crate) verloc: VerlocState,
|
|
pub(crate) stats: SharedNodeStats,
|
|
}
|
|
|
|
impl FromRef<MixnodeAppState> for VerlocState {
|
|
fn from_ref(app_state: &MixnodeAppState) -> Self {
|
|
app_state.verloc.clone()
|
|
}
|
|
}
|
|
|
|
impl FromRef<MixnodeAppState> for SharedNodeStats {
|
|
fn from_ref(app_state: &MixnodeAppState) -> Self {
|
|
app_state.stats.clone()
|
|
}
|
|
}
|