Skip to main content

Module state

Module state 

Source
Expand description

Implement a cache for onion descriptors and the facility to remember a bit about onion service history.

Re-exportsΒ§

use std::fmt::Debug; πŸ”’
use std::fmt::Debug; πŸ”’
use std::mem; πŸ”’
use std::panic::AssertUnwindSafe; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::Mutex; πŸ”’
use std::sync::MutexGuard; πŸ”’
use futures::FutureExt as _; πŸ”’
use futures::task::SpawnError; πŸ”’
use async_trait::async_trait; πŸ”’
use educe::Educe; πŸ”’
use either::Either; πŸ”’
use postage::stream::Stream as _; πŸ”’
use tracing::debug; πŸ”’
use tracing::error; πŸ”’
use tracing::instrument; πŸ”’
use tracing::instrument; πŸ”’
use tracing::trace; πŸ”’
use safelog::DisplayRedacted as _; πŸ”’
use tor_basic_utils::define_accessor_trait; πŸ”’
use tor_circmgr::isolation::Isolation; πŸ”’
use tor_error::Bug; πŸ”’
use tor_error::ErrorReport as _; πŸ”’
use tor_error::debug_report; πŸ”’
use tor_error::error_report; πŸ”’
use tor_error::internal; πŸ”’
use tor_hscrypto::pk::HsId; πŸ”’
use tor_netdir::NetDir; πŸ”’
use tor_rtcompat::scheduler::TaskHandle; πŸ”’
use tor_rtcompat::scheduler::TaskSchedule; πŸ”’
use tor_rtcompat::Runtime; πŸ”’
use tor_rtcompat::SpawnExt as _; πŸ”’
use web_time_compat::Duration; πŸ”’
use web_time_compat::Instant; πŸ”’
use crate::isol_map; πŸ”’
use crate::ConnError; πŸ”’
use crate::HsClientConnector; πŸ”’
use crate::HsClientSecretKeys; πŸ”’
use either::Either::*; πŸ”’

StructsΒ§

Config
Configuration, currently just some retry parameters
Services πŸ”’
Hidden services;, our connections to them, and history of connections, etc.
TableIndex πŸ”’

EnumsΒ§

ServiceState πŸ”’
Value in the Services data structure

ConstantsΒ§

MAX_RECHECKS πŸ”’
Number of times we’re willing to iterate round the state machine loop
RETAIN_CIRCUIT_AFTER_LAST_USE πŸ”’
C Tor MaxCircuitDirtiness
RETAIN_DATA_AFTER_LAST_USE πŸ”’
How long to retain cached data about a hidden service

TraitsΒ§

HsClientConnectorConfig
Configuration for an HS client connector
MockableConnectorData
Mocking for actual HS connection work, to let us test the Services state machine

FunctionsΒ§

obtain_circuit_or_continuation_info πŸ”’
Obtain a circuit from the Services table, or return a continuation

Type AliasesΒ§

Continuation πŸ”’
β€œContinuation” return type from obtain_circuit_or_continuation_info
ServiceRecord πŸ”’
Entry in the 2nd-level lookup array