pub struct Utf8Encoding;Expand description
The UTF-8 encoding type behind ONIG_ENCODING_UTF8.
Trait Implementations§
Source§impl Encoding for Utf8Encoding
impl Encoding for Utf8Encoding
Source§fn mbc_enc_len(&self, p: &[u8]) -> usize
fn mbc_enc_len(&self, p: &[u8]) -> usize
Returns the byte length of the multibyte character at position p.
Source§fn max_enc_len(&self) -> usize
fn max_enc_len(&self) -> usize
Maximum encoded character length in bytes
Source§fn min_enc_len(&self) -> usize
fn min_enc_len(&self) -> usize
Minimum encoded character length in bytes
Source§fn mbc_to_code(&self, p: &[u8], end: usize) -> OnigCodePoint
fn mbc_to_code(&self, p: &[u8], end: usize) -> OnigCodePoint
Decode a multibyte character to a code point
Source§fn code_to_mbclen(&self, code: OnigCodePoint) -> i32
fn code_to_mbclen(&self, code: OnigCodePoint) -> i32
Returns the byte length needed to encode a code point
Source§fn code_to_mbc(&self, code: OnigCodePoint, buf: &mut [u8]) -> i32
fn code_to_mbc(&self, code: OnigCodePoint, buf: &mut [u8]) -> i32
Encode a code point into buf, returns number of bytes written
Source§fn mbc_case_fold(
&self,
flag: OnigCaseFoldType,
pp: &mut usize,
end: usize,
source: &[u8],
fold_buf: &mut [u8],
) -> i32
fn mbc_case_fold( &self, flag: OnigCaseFoldType, pp: &mut usize, end: usize, source: &[u8], fold_buf: &mut [u8], ) -> i32
Case fold the character at pp, advance pp, write folded to fold_buf.
Returns the number of bytes written to fold_buf.
Source§fn apply_all_case_fold(
&self,
flag: OnigCaseFoldType,
f: &mut dyn FnMut(OnigCodePoint, &[OnigCodePoint]) -> i32,
) -> i32
fn apply_all_case_fold( &self, flag: OnigCaseFoldType, f: &mut dyn FnMut(OnigCodePoint, &[OnigCodePoint]) -> i32, ) -> i32
Apply function f to all case fold pairs.
Source§fn get_case_fold_codes_by_str(
&self,
flag: OnigCaseFoldType,
p: &[u8],
end: usize,
items: &mut [OnigCaseFoldCodeItem],
) -> i32
fn get_case_fold_codes_by_str( &self, flag: OnigCaseFoldType, p: &[u8], end: usize, items: &mut [OnigCaseFoldCodeItem], ) -> i32
Get case fold code alternatives for the character at p.
Source§fn property_name_to_ctype(&self, p: &[u8]) -> i32
fn property_name_to_ctype(&self, p: &[u8]) -> i32
Convert property name to ctype value.
Source§fn is_code_ctype(&self, code: OnigCodePoint, ctype: u32) -> bool
fn is_code_ctype(&self, code: OnigCodePoint, ctype: u32) -> bool
Is the code point of the given ctype?
Source§fn get_ctype_code_range(
&self,
ctype: u32,
sb_out: &mut OnigCodePoint,
) -> Option<&'static [OnigCodePoint]>
fn get_ctype_code_range( &self, ctype: u32, sb_out: &mut OnigCodePoint, ) -> Option<&'static [OnigCodePoint]>
Get the code range for a ctype.
Source§fn left_adjust_char_head(&self, start: usize, s: usize, data: &[u8]) -> usize
fn left_adjust_char_head(&self, start: usize, s: usize, data: &[u8]) -> usize
Left adjust char head: find the start of the character containing s
within [start..].
Source§fn is_allowed_reverse_match(&self, _p: &[u8]) -> bool
fn is_allowed_reverse_match(&self, _p: &[u8]) -> bool
Is reverse matching allowed at this position?
Source§fn is_valid_mbc_string(&self, s: &[u8]) -> bool
fn is_valid_mbc_string(&self, s: &[u8]) -> bool
Validate that the byte string is valid for this encoding
Source§fn sb_range(&self) -> OnigCodePoint
fn sb_range(&self) -> OnigCodePoint
Single-byte range boundary
Source§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is this encoding initialized?
Auto Trait Implementations§
impl Freeze for Utf8Encoding
impl RefUnwindSafe for Utf8Encoding
impl Send for Utf8Encoding
impl Sync for Utf8Encoding
impl Unpin for Utf8Encoding
impl UnsafeUnpin for Utf8Encoding
impl UnwindSafe for Utf8Encoding
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