Files
nym/mixnode/src/node/http/state.rs
T
Jędrzej Stuczyński da9d743f39 [mixnode] replace rocket with axum (#4071)
* axum-equivalent mixnode http api routes

* replaced all rocket routes with axum equivalents

* removed '_axum' suffix from the routes
2023-10-30 12:55:42 +00:00

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()
}
}