pub struct SentenceConfigBuilder { /* private fields */ }Expand description
The builder for SentenceConfig.
By default, the config creates a sentence with two adjectives, one adverb, and plural nouns
following the “AdjectivesNounVerbAdverbs” Structure.
§Example
let config = SentenceConfigBuilder::new()
.adjectives(3)
.adverbs(2)
.plural(false)
.build();Implementations§
Source§impl SentenceConfigBuilder
impl SentenceConfigBuilder
pub fn new() -> Self
pub fn random() -> Self
pub fn adjectives(self, n: u16) -> Self
pub fn adverbs(self, n: u16) -> Self
pub fn structure(self, n: Structure) -> Self
pub fn plural(self, n: bool) -> Self
Sourcepub fn on_adjectives(self, n: u16) -> Self
pub fn on_adjectives(self, n: u16) -> Self
The number of adjectives attached to the object noun. This only has an effect if the
Structure is “AdjectivesNounVerbAdverbsNounAdjectives” or
“AdjectivesNounVerbAdverbsAdjectivesNoun”
Sourcepub fn on_plural(self, n: bool) -> Self
pub fn on_plural(self, n: bool) -> Self
Whether the object noun is plural or not. This only has an effect if the
Structure is “AdjectivesNounVerbAdverbsNounAdjectives” or
“AdjectivesNounVerbAdverbsAdjectivesNoun”
pub fn build(self) -> SentenceConfig
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SentenceConfigBuilder
impl RefUnwindSafe for SentenceConfigBuilder
impl Send for SentenceConfigBuilder
impl Sync for SentenceConfigBuilder
impl Unpin for SentenceConfigBuilder
impl UnwindSafe for SentenceConfigBuilder
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