mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-22 19:24:08 +00:00
Additional documentation
This commit is contained in:
@@ -109,6 +109,7 @@ impl Default for Config {
|
||||
}}
|
||||
}
|
||||
|
||||
/// The main entry point to the library
|
||||
pub struct Endpoint {
|
||||
log: Logger,
|
||||
rng: OsRng,
|
||||
@@ -143,9 +144,20 @@ fn reset_token_for(key: &[u8], id: &ConnectionId) -> [u8; 16] {
|
||||
result
|
||||
}
|
||||
|
||||
/// Information that should be preserved between restarts
|
||||
///
|
||||
/// Keeping this around allows better behavior by clients that communicated with a previous instance of the same
|
||||
/// endpoint.
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct PersistentState {
|
||||
/// Cryptographic key used to ensure integrity of data included in handshake cookies.
|
||||
///
|
||||
/// Initialize with random bytes.
|
||||
pub cookie_key: [u8; 64],
|
||||
/// Cryptographic key used to send authenticated connection resets to clients who were communicating with a previous
|
||||
/// instance of tihs endpoint.
|
||||
///
|
||||
/// Initialize with random bytes.
|
||||
pub reset_key: [u8; 64],
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ impl From<Error> for u16 { fn from(x: Error) -> u16 { x.0 } }
|
||||
macro_rules! errors {
|
||||
{$($name:ident($val:expr) $desc:expr;)*} => {
|
||||
impl Error {
|
||||
$(pub const $name: Self = Error($val);)*
|
||||
$(#[doc = $desc] pub const $name: Self = Error($val);)*
|
||||
}
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
|
||||
Reference in New Issue
Block a user