pub struct OpenCC {
pub config: String,
/* private fields */
}
Fields§
§config: String
Configuration file
Implementations§
Source§impl OpenCC
impl OpenCC
Sourcepub fn convert(&self, text: &str) -> String
pub fn convert(&self, text: &str) -> String
Convert a text
§Examples
let cc = opencc::OpenCC::new("t2s.json");
cc.convert("乾坤一擲");
cc.convert("開放中文轉換");
Sourcepub fn last_error(&mut self) -> Option<String>
pub fn last_error(&mut self) -> Option<String>
Returns the last error message
§Safety
Note that this function is the only one which is NOT thread-safe.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenCC
impl RefUnwindSafe for OpenCC
impl Unpin for OpenCC
impl UnwindSafe for OpenCC
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