feat: implement Phase 2 RNS carrier

This commit is contained in:
randogoth 2026-09-28 16:49:34 +03:00
parent 37df976fde
commit 22fe9f1b9f
14 changed files with 1439 additions and 12 deletions

View file

@ -66,9 +66,32 @@ pub fn connect(
unpinned_static,
})
}
Scheme::Rns => Err(SmolError::new(
"smol+rns:// addresses need the rns feature; rebuild with --features rns",
)),
Scheme::Rns => {
// There is nothing to pin on this carrier (upstream spec 13.4):
// the destination hash is the pin, so `require_pin` decides
// nothing here and every session is as authenticated as a
// pinned TCP one.
#[cfg(feature = "rns")]
{
let _ = require_pin;
let destination = addr.destination()?;
let transport = crate::rns::transport::RnsTransport::connect(
&destination,
std::time::Duration::from_secs(timeout),
)?;
Ok(Session {
transport: Box::new(transport),
unpinned_static: None,
})
}
#[cfg(not(feature = "rns"))]
{
let _ = (addr, require_pin);
Err(SmolError::new(
"smol+rns:// addresses need the rns feature; rebuild with --features rns",
))
}
}
}
}