pub struct ArabicReshaper { /* private fields */ }Expand description
§ArabicReshaper
the main type for reconstructing sentences to be used in applications that don’t support Arabic script.
Implementations§
Source§impl ArabicReshaper
impl ArabicReshaper
Sourcepub const fn new(config: ReshaperConfig) -> Self
pub const fn new(config: ReshaperConfig) -> Self
Create a new ArabicReshaper using the given config
Sourcepub fn need_reshape<S>(&self, text: S) -> bool
pub fn need_reshape<S>(&self, text: S) -> bool
Check whatever the text need reshaping or not.
Sourcepub fn reshape<S>(&self, text: S) -> String
pub fn reshape<S>(&self, text: S) -> String
Reshape the given line and return the reshaped string
Examples found in repository?
More examples
Sourcepub fn reshape_lines<S, L>(&self, lines: L) -> Vec<String>
pub fn reshape_lines<S, L>(&self, lines: L) -> Vec<String>
Reshape all lines in the given slice and return a new Vec
Sourcepub fn modify_config<F>(&mut self, func: F)where
F: FnOnce(&mut ReshaperConfig),
pub fn modify_config<F>(&mut self, func: F)where
F: FnOnce(&mut ReshaperConfig),
A safe way to modify the config (ReshaperConfig) after creating the ArabicReshaper.
Trait Implementations§
Source§impl Clone for ArabicReshaper
impl Clone for ArabicReshaper
Source§fn clone(&self) -> ArabicReshaper
fn clone(&self) -> ArabicReshaper
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 Default for ArabicReshaper
impl Default for ArabicReshaper
Source§fn default() -> ArabicReshaper
fn default() -> ArabicReshaper
Returns the “default value” for a type. Read more
Source§impl From<ReshaperConfig> for ArabicReshaper
impl From<ReshaperConfig> for ArabicReshaper
Source§fn from(value: ReshaperConfig) -> Self
fn from(value: ReshaperConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ArabicReshaper
impl RefUnwindSafe for ArabicReshaper
impl Send for ArabicReshaper
impl Sync for ArabicReshaper
impl Unpin for ArabicReshaper
impl UnwindSafe for ArabicReshaper
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