Struct strcursor::grapheme::GcBuf [] [src]

pub struct GcBuf(_);

An owned, single Unicode grapheme cluster (akin to String).

See Gc for more details.

Methods

impl GcBuf
[src]

unsafe fn from_string_unchecked(s: String) -> GcBuf

Create a new GcBuf from the given String.

This function does not check to ensure the provided string is a single, valid grapheme cluster.

fn as_gc(&self) -> &Gc

Returns a borrowed grapheme cluster slice.

Methods from Deref<Target=Gc>

fn len(&self) -> usize

Returns the length of this grapheme cluster in bytes.

fn has_marks(&self) -> bool

Does this grapheme cluster have additional marks applied to it?

This is true if the cluster is comprised of more than a single code point.

fn as_bytes(&self) -> &[u8]

Converts this to a byte slice.

fn as_str(&self) -> &str

Converts this to a string slice.

fn base_char(&self) -> char

Returns the "base" code point.

That is, this returns the first code point in the cluster.

fn base(&self) -> &Gc

Returns the "base" code point as a grapheme cluster.

This is equivalent to converting this GC into a string slice, then slicing off the bytes that make up the first code point.

fn mark_str(&self) -> &str

Returns the combining marks as a string slice.

The result of this method may be empty, or of arbitrary length.

fn chars(&self) -> Chars

An iterator over the code points of this grapheme cluster.

fn char_indices(&self) -> CharIndices

An iterator over the code points of this grapheme cluster, and their associated byte offsets.

fn bytes(&self) -> Bytes

An iterator over the bytes of this grapheme cluster.

fn to_lowercase(&self) -> ToLowercase

Returns an iterator over the code points in the lower case equivalent of this grapheme cluster.

fn to_uppercase(&self) -> ToUppercase

Returns an iterator over the code points in the upper case equivalent of this grapheme cluster.

Trait Implementations

impl Hash for GcBuf
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl PartialOrd for GcBuf
[src]

fn partial_cmp(&self, __arg_0: &GcBuf) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &GcBuf) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &GcBuf) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &GcBuf) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &GcBuf) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for GcBuf
[src]

fn cmp(&self, __arg_0: &GcBuf) -> Ordering

This method returns an Ordering between self and other. Read more

impl PartialEq for GcBuf
[src]

fn eq(&self, __arg_0: &GcBuf) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &GcBuf) -> bool

This method tests for !=.

impl Eq for GcBuf
[src]

impl Clone for GcBuf
[src]

fn clone(&self) -> GcBuf

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl AsRef<Gc> for GcBuf
[src]

fn as_ref(&self) -> &Gc

Performs the conversion.

impl AsRef<str> for GcBuf
[src]

fn as_ref(&self) -> &str

Performs the conversion.

impl AsRef<[u8]> for GcBuf
[src]

fn as_ref(&self) -> &[u8]

Performs the conversion.

impl Borrow<Gc> for GcBuf
[src]

fn borrow(&self) -> &Gc

Immutably borrows from an owned value. Read more

impl Debug for GcBuf
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Default for GcBuf
[src]

fn default() -> Self

Returns the "default value" for a type. Read more

impl Deref for GcBuf
[src]

type Target = Gc

The resulting type after dereferencing

fn deref(&self) -> &Gc

The method called to dereference a value

impl Display for GcBuf
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<'a> From<&'a Gc> for GcBuf
[src]

fn from(v: &'a Gc) -> Self

Performs the conversion.

impl From<char> for GcBuf
[src]

fn from(v: char) -> Self

Performs the conversion.

impl Into<Box<str>> for GcBuf
[src]

fn into(self) -> Box<str>

Performs the conversion.

impl Into<String> for GcBuf
[src]

fn into(self) -> String

Performs the conversion.

impl Into<Vec<u8>> for GcBuf
[src]

fn into(self) -> Vec<u8>

Performs the conversion.

impl PartialEq<char> for GcBuf
[src]

fn eq(&self, other: &char) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl PartialEq<str> for GcBuf
[src]

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl PartialEq<Gc> for GcBuf
[src]

fn eq(&self, other: &Gc) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl PartialEq<String> for GcBuf
[src]

fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<'a> PartialEq<&'a str> for GcBuf
[src]

fn eq(&self, other: &&'a str) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<'a> PartialEq<&'a Gc> for GcBuf
[src]

fn eq(&self, other: &&'a Gc) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<'a> PartialEq<Cow<'a, Gc>> for GcBuf
[src]

fn eq(&self, other: &Cow<'a, Gc>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl PartialOrd<char> for GcBuf
[src]

fn partial_cmp(&self, other: &char) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<str> for GcBuf
[src]

fn partial_cmp(&self, other: &str) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<Gc> for GcBuf
[src]

fn partial_cmp(&self, other: &Gc) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialOrd<String> for GcBuf
[src]

fn partial_cmp(&self, other: &String) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> PartialOrd<&'a str> for GcBuf
[src]

fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> PartialOrd<&'a Gc> for GcBuf
[src]

fn partial_cmp(&self, other: &&'a Gc) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> PartialOrd<Cow<'a, Gc>> for GcBuf
[src]

fn partial_cmp(&self, other: &Cow<'a, Gc>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more