pub struct Rules { /* private fields */ }
Expand description
An ordered set of rules. Rules are executed in order. Once a rule matches on an index, no other rule can match at the same index. Each rule either breaks (i. e. splits the text at this index) or prevents breaking.
Implementations§
source§impl Rules
impl Rules
sourcepub fn split_ranges(&self, text: &str) -> Vec<Range<usize>>
pub fn split_ranges(&self, text: &str) -> Vec<Range<usize>>
Obtain the ranges for text segments. Guaranteed to be at character bounds.
sourcepub fn split<'a, 'b>(&self, text: &'a str) -> impl Iterator<Item = &'a str> + 'bwhere
'a: 'b,
pub fn split<'a, 'b>(&self, text: &'a str) -> impl Iterator<Item = &'a str> + 'bwhere 'a: 'b,
Split text into segments.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
source§impl<'de> Deserialize<'de> for Rules
impl<'de> Deserialize<'de> for Rules
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 RefUnwindSafe for Rules
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl UnwindSafe for Rules
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