INNER CODE UNIT · Rust
is_empty
CluvexStudio/Aether · aether/src/lib.rs:183
fn is_empty(&self) -> bool {
self.outer.is_none() && self.inner.is_none()
}
/// The hops have to leave through different edges: sending the inner tunnel
/// back out of the address it already arrived on gains nothing, and
/// `run_warp_in_warp` refuses it.
fn checked(self) -> Result<Self> {
match (self.outer, self.inner) {
(Some(outer), Some(inner)) if outer.ip() == inner.ip() => {
Err(AetherError::Other(format!(
"warp-in-warp needs two separate edges, but both hops point at {}",
outer.ip()
)))
}
_ => Ok(self),
}
}