pub struct NativeSegment { /* private fields */ }Implementations§
Source§impl NativeSegment
impl NativeSegment
Source§impl NativeSegment
impl NativeSegment
pub fn into_reference( val: NativeSegment, env: Env, ) -> Result<Reference<NativeSegment>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<NativeSegment>>
Source§impl NativeSegment
impl NativeSegment
pub fn create(options: Option<JsSegmentOptions>) -> Result<Self>
pub fn with_node_novel_default() -> Result<Self>
pub fn do_segment( &self, text: String, options: Option<JsDoSegmentOptions>, ) -> Result<Vec<JsWord>>
pub fn do_segment_simple( &self, text: String, options: Option<JsDoSegmentOptions>, ) -> Result<Vec<String>>
pub fn stringify( &self, text: String, options: Option<JsDoSegmentOptions>, ) -> Result<String>
pub fn add_word( &self, spec: String, p: Option<u32>, f: Option<f64>, ) -> Result<()>
pub fn add_synonym( &self, canonical: String, variants: Vec<String>, ) -> Result<()>
pub fn add_blacklist(&self, word: String) -> Result<()>
Trait Implementations§
Source§impl FromNapiMutRef for NativeSegment
impl FromNapiMutRef for NativeSegment
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for NativeSegment
impl FromNapiRef for NativeSegment
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &NativeSegment
impl FromNapiValue for &NativeSegment
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut NativeSegment
impl FromNapiValue for &mut NativeSegment
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for NativeSegment
impl ToNapiValue for NativeSegment
Source§unsafe fn to_napi_value(env: napi_env, val: NativeSegment) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: NativeSegment) -> Result<napi_value>
Safety Read more
Source§impl TypeName for NativeSegment
impl TypeName for NativeSegment
Source§impl TypeName for &NativeSegment
impl TypeName for &NativeSegment
Source§impl TypeName for &mut NativeSegment
impl TypeName for &mut NativeSegment
Source§impl ValidateNapiValue for &NativeSegment
impl ValidateNapiValue for &NativeSegment
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut NativeSegment
impl ValidateNapiValue for &mut NativeSegment
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl !Freeze for NativeSegment
impl RefUnwindSafe for NativeSegment
impl Send for NativeSegment
impl Sync for NativeSegment
impl Unpin for NativeSegment
impl UnsafeUnpin for NativeSegment
impl UnwindSafe for NativeSegment
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