pub struct LineBreakConfig {
pub max_chars_per_line: u8,
pub max_cps: f32,
pub max_lines: u8,
pub min_gap_ms: u32,
pub hard_max_chars: Option<u8>,
}Expand description
Configuration for line-breaking behaviour.
Fields§
§max_chars_per_line: u8Maximum characters per line.
max_cps: f32Maximum reading speed in characters per second.
max_lines: u8Maximum number of lines in a caption block.
min_gap_ms: u32Minimum gap between successive caption blocks in milliseconds.
hard_max_chars: Option<u8>Hard maximum characters per line (enforced even if max_chars_per_line
would allow more). None means no additional constraint.
Implementations§
Source§impl LineBreakConfig
impl LineBreakConfig
Sourcepub fn default_broadcast() -> Self
pub fn default_broadcast() -> Self
Sensible broadcast defaults: 42 chars/line, 17 CPS, 2 lines, 80ms gap.
Sourcepub fn effective_max_chars(&self) -> u8
pub fn effective_max_chars(&self) -> u8
Effective maximum characters per line considering the hard cap.
Trait Implementations§
Source§impl Clone for LineBreakConfig
impl Clone for LineBreakConfig
Source§fn clone(&self) -> LineBreakConfig
fn clone(&self) -> LineBreakConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LineBreakConfig
impl Debug for LineBreakConfig
Source§impl PartialEq for LineBreakConfig
impl PartialEq for LineBreakConfig
impl StructuralPartialEq for LineBreakConfig
Auto Trait Implementations§
impl Freeze for LineBreakConfig
impl RefUnwindSafe for LineBreakConfig
impl Send for LineBreakConfig
impl Sync for LineBreakConfig
impl Unpin for LineBreakConfig
impl UnsafeUnpin for LineBreakConfig
impl UnwindSafe for LineBreakConfig
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