Extend some comments about bridge descriptors

This commit is contained in:
Nick Mathewson 2022-10-06 12:56:28 -04:00
parent fac975ddfb
commit 3f419f7f65
2 changed files with 11 additions and 2 deletions

View File

@ -18,6 +18,10 @@ use tor_netdoc::doc::routerdesc::RouterDesc;
#[derive(Clone, Debug)]
pub struct BridgeDesc {
/// The inner descriptor.
///
/// NOTE: This is wrapped in an `Arc<>` because we expect to pass BridgeDesc
/// around a bit and clone it frequently. If that doesn't actually happen,
/// we can remove the Arc here.
desc: Arc<RouterDesc>,
}

View File

@ -6,7 +6,8 @@ use tor_linkspec::{ChanTarget, CircTarget, HasAddrs, HasRelayIds, RelayIdRef, Re
use super::{Bridge, BridgeDesc};
/// The information about a Bridge that is necessary to connect to it and relay traffic.
/// The information about a Bridge that is necessary to connect to it and send
/// it traffic.
#[derive(Clone, Debug)]
pub struct BridgeRelay {
@ -23,7 +24,11 @@ pub struct BridgeRelay {
}
/// A BridgeRelay that is known to have its full information available, and
/// which is therefore usable for circuits.
/// which is therefore usable for multi-hop circuits.
///
/// (All bridges can be used for single-hop circuits, but we need to know the
/// bridge's descriptor in order to construct proper multi-hop circuits
/// with forward secrecy through it.)
#[derive(Clone, Debug)]
pub struct BridgeRelayWithDesc<'a>(
/// This will _always_ be a bridge relay with a non-None desc.