#[non_exhaustive]pub struct PairingOptions {
pub invitation: bool,
pub pin: bool,
pub pin_shown: bool,
pub device: bool,
pub pin_alphabet: CodeAlphabet,
pub pin_ttl: Option<Duration>,
pub pin_attempts: u32,
pub user_code_alphabet: CodeAlphabet,
pub device_ttl: Option<Duration>,
}Expand description
What a responder offers and how its codes are made. Every field has a default; any value
with a meaning is accepted, and non_defaults lists the ones that
differ from their default. Every key is optional and an unknown key is refused; a duration
reads as 600, 90s or 250ms, and pin_ttl and device_ttl also read never.
#[non_exhaustive]: start from Default and assign the fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.invitation: boolWhether joiners may pair with an invitation. Default true.
pin: boolWhether joiners may pair with a PIN (needs the pin feature). Default true.
pin_shown: boolWhether a joiner may show a PIN for an operator to type into this side, which holds its
run until the operator answers or pin_ttl passes. Turn it off where nobody is there
to answer. Default true.
device: boolWhether joiners may pair by the device flow. Default true.
pin_alphabet: CodeAlphabetThe alphabet and length of a PIN the desk shows. Default 0123456789 × 6.
pin_ttl: Option<Duration>How long a shown PIN, or a slot waiting for a joiner’s PIN, lasts; None (the text
never) lasts for good. Default 10 minutes; it is also the window of
DeskLimits::pin_runs_per_source.
pin_attempts: u32How many runs may try a shown PIN before it is burned; a run counts once it is past the first PAKE message, whatever its outcome. Default 1.
user_code_alphabet: CodeAlphabetThe alphabet and length of a device-flow user code. Default RFC 8628’s
BCDFGHJKLMNPQRSTVWXZ × 8.
device_ttl: Option<Duration>How long a user code waits for approval; None (the text never) waits for good.
Default 10 minutes; it is also the window of DeskLimits::wrong_codes_total.
Implementations§
Source§impl PairingOptions
impl PairingOptions
Sourcepub fn check(&self) -> Result<(), Error>
pub fn check(&self) -> Result<(), Error>
Whether every option has a meaning.
§Errors
Error::InvalidOptions for a meaningless alphabet, a zero TTL or zero attempts.
Sourcepub fn non_defaults(&self) -> Vec<NonDefault>
pub fn non_defaults(&self) -> Vec<NonDefault>
Every option that differs from its default, named by key path (pin_attempts,
pin_alphabet.len).