pub enum RendCheckResult {
Valid,
Overused {
fingerprint: String,
usage_rate: f64,
expected_weight: f64,
},
}Expand description
Result of checking a rendezvous point usage.
Returned by usage validation to indicate whether a rendezvous point selection is valid or represents a potential statistical attack.
§Example
use vanguards_rs::rendguard::RendCheckResult;
fn handle_rend_check(result: RendCheckResult) {
match result {
RendCheckResult::Valid => {
println!("RP usage is within expected bounds");
}
RendCheckResult::Overused { fingerprint, usage_rate, expected_weight } => {
println!(
"Potential attack: {} used {:.2}% vs expected {:.2}%",
fingerprint, usage_rate, expected_weight
);
}
}
}§See Also
RendGuard::valid_rend_use- Validation methodRendGuard::is_overused- Direct overuse check
Variants§
Valid
Usage is valid, circuit can proceed.
The relay’s usage rate is within acceptable bounds relative to its bandwidth weight.
Overused
Relay is overused, circuit should be closed.
The relay is being used as a rendezvous point more frequently than expected based on its bandwidth. This may indicate a statistical attack attempting to correlate hidden service activity.
Trait Implementations§
Source§impl Clone for RendCheckResult
impl Clone for RendCheckResult
Source§fn clone(&self) -> RendCheckResult
fn clone(&self) -> RendCheckResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RendCheckResult
impl Debug for RendCheckResult
Source§impl PartialEq for RendCheckResult
impl PartialEq for RendCheckResult
impl StructuralPartialEq for RendCheckResult
Auto Trait Implementations§
impl Freeze for RendCheckResult
impl RefUnwindSafe for RendCheckResult
impl Send for RendCheckResult
impl Sync for RendCheckResult
impl Unpin for RendCheckResult
impl UnwindSafe for RendCheckResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more