tor-circmgr: impl Display for TargetPort
This will be used for error handling, and perhaps other things.
This commit is contained in:
parent
5edd031b97
commit
a7e6caa731
|
@ -2,6 +2,7 @@
|
|||
|
||||
use rand::Rng;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::{self, Display};
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::Arc;
|
||||
use tracing::debug;
|
||||
|
@ -59,6 +60,12 @@ impl TargetPort {
|
|||
}
|
||||
}
|
||||
|
||||
impl Display for TargetPort {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}{}", self.port, if self.ipv6 { "v6" } else { "v4" })
|
||||
}
|
||||
}
|
||||
|
||||
/// A token used to isolate unrelated streams on different circuits.
|
||||
///
|
||||
/// When two streams are associated with different isolation tokens, they
|
||||
|
|
Loading…
Reference in New Issue