pub struct StyleProfileBuilder { /* private fields */ }Expand description
Builder for StyleProfile.
Construct via StyleProfile::builder and chain dial setters; finalize
with build(), which runs StyleProfile::validate before returning
the profile so misconfigurations surface at construction rather than at
render time.
Implementations§
Source§impl StyleProfileBuilder
impl StyleProfileBuilder
pub fn verbosity(self, v: Verbosity) -> Self
pub fn sentence_length(self, distribution: LengthDistribution) -> Self
pub fn connectives(self, prefs: ConnectivePreferences) -> Self
Sourcepub fn allow_connectives(
self,
relation: RstRelation,
pool: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn allow_connectives( self, relation: RstRelation, pool: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Append an allowed-pool entry for one RST relation.
Sourcepub fn prefer_connectives(
self,
relation: RstRelation,
weights: impl IntoIterator<Item = (impl Into<String>, f32)>,
) -> Self
pub fn prefer_connectives( self, relation: RstRelation, weights: impl IntoIterator<Item = (impl Into<String>, f32)>, ) -> Self
Append a preferred-weight entry for one RST relation.
pub fn list_style_bias(self, bias: ListStyleBias) -> Self
pub fn pronoun_density(self, density: PronounDensity) -> Self
pub fn hedging(self, calibration: HedgingCalibration) -> Self
pub fn forbid_hedge(self, hedge: impl Into<String>) -> Self
pub fn hedging_offset(self, offset: i8) -> Self
pub fn salience(self, bias: SalienceBias) -> Self
Sourcepub fn build(self) -> Result<StyleProfile, StyleProfileError>
pub fn build(self) -> Result<StyleProfile, StyleProfileError>
Validate and finalize. Returns StyleProfileError if any dial
violates the documented invariants.
Sourcepub fn build_or_panic(self) -> StyleProfile
pub fn build_or_panic(self) -> StyleProfile
Validate-or-panic finalize; useful in const-style top-level catalogs
where a panic is preferable to a ? chain. Production builders
should prefer Self::build.
Trait Implementations§
Source§impl Clone for StyleProfileBuilder
impl Clone for StyleProfileBuilder
Source§fn clone(&self) -> StyleProfileBuilder
fn clone(&self) -> StyleProfileBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StyleProfileBuilder
impl RefUnwindSafe for StyleProfileBuilder
impl Send for StyleProfileBuilder
impl Sync for StyleProfileBuilder
impl Unpin for StyleProfileBuilder
impl UnsafeUnpin for StyleProfileBuilder
impl UnwindSafe for StyleProfileBuilder
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