pub struct Config {
pub subs: BTreeMap<String, WordKind>,
pub extended: bool,
/* private fields */
}Fields§
§subs: BTreeMap<String, WordKind>§extended: boolImplementations§
Source§impl Config
impl Config
Sourcepub fn from_path(path: &Path, extended: bool) -> Result<Config>
pub fn from_path(path: &Path, extended: bool) -> Result<Config>
§Errors
Returns an error if not able to open and read the file at the given path
Sourcepub fn dump(&self) -> Result<String>
pub fn dump(&self) -> Result<String>
§Errors
Returns an error if not able to serialize to a pretty JSON string
Sourcepub fn list(&self, sub: &str) -> Result<Vec<String>>
pub fn list(&self, sub: &str) -> Result<Vec<String>>
§Errors
Returns an error if not able to resolve the given sub &str
Sourcepub fn codename_series(&self, n: usize) -> String
pub fn codename_series(&self, n: usize) -> String
Generate a “code name series”
TAKENSTAR PRINTEDBOARD
TAKENSTAR GONEWAGON
TAKENSTAR PROUDCOOK
TAKENSTAR YOURLEAVE
TAKENSTAR DONEPARTY
TAKENSTAR USUALENTER
TAKENSTAR FOURBOAT
TAKENSTAR NICEABOVE
TAKENSTAR FRENCHPASS
TAKENSTAR FINEWAVESourcepub fn haiku(&self, variant: HaikuVariant) -> String
pub fn haiku(&self, variant: HaikuVariant) -> String
Generate a haiku
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more