Movatterモバイル変換


[0]ホーム

URL:


unicode_width

Traitunicode_width::UnicodeWidthStr [][src]

pub trait UnicodeWidthStr {    fnwidth<'a>(&'a self) ->usize;    fnwidth_cjk<'a>(&'a self) ->usize;}

Methods for determining displayed width of Unicode strings.

Required Methods

fnwidth<'a>(&'a self) ->usize

Returns the string's displayed width in columns.

Control characters are treated as having zero width.

This function treats characters in the Ambiguous category accordingtoUnicode Standard Annex #11as 1 column wide. This is consistent with the recommendations fornon-CJK contexts, or when the context cannot be reliably determined.

fnwidth_cjk<'a>(&'a self) ->usize

Returns the string's displayed width in columns.

Control characters are treated as having zero width.

This function treats characters in the Ambiguous category accordingtoUnicode Standard Annex #11as 2 column wide. This is consistent with the recommendations forCJK contexts.

Implementors

Keyboard shortcuts

?
Show this help dialog
S
Focus the search field
Move up in search results
Move down in search results
Go to active search result

Search tricks

Prefix searches with a type followed by a colon (e.g.fn:) to restrict the search to a given type.

Accepted types are:fn,mod,struct,enum,trait,typedef (ortdef).

Search functions by type signature (e.g.vec -> usize)


[8]ページ先頭

©2009-2025 Movatter.jp