pub struct DictionaryConfig {Show 13 fields
pub dictionary_type: DictionaryType,
pub chars: String,
pub start: Option<String>,
pub length: Option<usize>,
pub start_codepoint: Option<u32>,
pub words: Option<Vec<String>>,
pub words_file: Option<String>,
pub delimiter: Option<String>,
pub case_sensitive: Option<bool>,
pub alternating: Option<Vec<String>>,
pub mode: Option<EncodingMode>,
pub padding: Option<String>,
pub common: bool,
}Expand description
Configuration for a single dictionary loaded from TOML.
Fields§
§dictionary_type: DictionaryTypeDictionary type: “char” (default) or “word”
chars: StringThe characters comprising the dictionary (explicit list)
start: Option<String>Starting character for range-based dictionary definition
Use with length to define sequential Unicode ranges
length: Option<usize>Number of characters in range-based dictionary
Use with start to define sequential Unicode ranges
start_codepoint: Option<u32>Starting Unicode codepoint for ByteRange mode (256 chars)
words: Option<Vec<String>>Inline word list for word-based dictionaries
words_file: Option<String>Path to external word list file (one word per line)
delimiter: Option<String>Delimiter between words in encoded output (default: “ “)
case_sensitive: Option<bool>Whether word matching is case-sensitive (default: false)
alternating: Option<Vec<String>>Names of sub-dictionaries for alternating word encoding (e.g., [“pgp_even”, “pgp_odd”])
mode: Option<EncodingMode>The encoding mode to use (auto-detected if not specified)
padding: Option<String>Optional padding character (e.g., “=” for base64)
common: boolWhether this dictionary renders consistently across platforms (default: true) Dictionaries with common=false are excluded from random selection (–dejavu)
Implementations§
Source§impl DictionaryConfig
impl DictionaryConfig
Sourcepub fn effective_chars(&self) -> Result<String, String>
pub fn effective_chars(&self) -> Result<String, String>
Returns the effective character set, generating from range if needed.
Priority:
- If
charsis non-empty, use it directly - If
start+lengthare set, generate sequential range - Otherwise return empty string (ByteRange mode uses start_codepoint instead)
Sourcepub fn effective_mode(&self) -> EncodingMode
pub fn effective_mode(&self) -> EncodingMode
Returns the effective encoding mode, auto-detecting if not explicitly set.
Auto-detection rules:
- ByteRange: Must be explicitly set (requires start_codepoint)
- Chunked: If alphabet length is a power of 2
- Radix: Otherwise (true base conversion)
Trait Implementations§
Source§impl Clone for DictionaryConfig
impl Clone for DictionaryConfig
Source§fn clone(&self) -> DictionaryConfig
fn clone(&self) -> DictionaryConfig
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DictionaryConfig
impl Debug for DictionaryConfig
Source§impl Default for DictionaryConfig
impl Default for DictionaryConfig
Source§impl<'de> Deserialize<'de> for DictionaryConfig
impl<'de> Deserialize<'de> for DictionaryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DictionaryConfig
impl RefUnwindSafe for DictionaryConfig
impl Send for DictionaryConfig
impl Sync for DictionaryConfig
impl Unpin for DictionaryConfig
impl UnwindSafe for DictionaryConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)