Struct omgwtf8::OmgWtf8
[−]
[src]
pub struct OmgWtf8(_);
An OMG-WTF-8 string.
Methods
impl OmgWtf8
[src]
impl OmgWtf8
[src]
fn from_str(s: &str) -> &Self
[src]
Creates a new OMG-WTF-8 string from a UTF-8 string.
fn to_str(&self) -> Option<&str>
[src]
If this string is valid UTF-8, returns this string cast to a &str
.
If this string contains unpaired surrogates, returns None
.
fn from_wide(ucs2: &[u16]) -> Box<Self>
[src]
Converts from UCS-2 to OMG-WTF-8.
fn encode_wide(&self) -> EncodeWide
[src]
Trait Implementations
impl Index<RangeFull> for OmgWtf8
[src]
Allows OMG-WTF-8 strings be sliced using s[..]
.
type Output = Self
The returned type after indexing.
fn index(&self, _: RangeFull) -> &Self
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeTo<usize>> for OmgWtf8
[src]
Allows OMG-WTF-8 strings be sliced using s[..j]
.
type Output = Self
The returned type after indexing.
fn index(&self, range: RangeTo<usize>) -> &Self
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeFrom<usize>> for OmgWtf8
[src]
Allows OMG-WTF-8 strings be sliced using s[i..]
.
type Output = Self
The returned type after indexing.
fn index(&self, range: RangeFrom<usize>) -> &Self
[src]
Performs the indexing (container[index]
) operation.
impl Index<Range<usize>> for OmgWtf8
[src]
Allows OMG-WTF-8 strings be sliced using s[i..j]
.
type Output = Self
The returned type after indexing.
fn index(&self, range: Range<usize>) -> &Self
[src]
Performs the indexing (container[index]
) operation.
impl<'a> From<&'a str> for &'a OmgWtf8
[src]
impl Debug for OmgWtf8
[src]
impl Eq for OmgWtf8
[src]
Two OMG-WTF-8 strings can be compared for equality.
impl PartialEq for OmgWtf8
[src]
Two OMG-WTF-8 strings can be compared for partial equality.
fn eq(&self, other: &Self) -> bool
[src]
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[src]
This method tests for !=
.
impl Ord for OmgWtf8
[src]
Two OMG-WTF-8 strings can be totally ordered.
Note that the exact ordering is unspecified when unpaired surrogate exists.
fn cmp(&self, other: &Self) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for OmgWtf8
[src]
Two OMG-WTF-8 strings can be partially ordered.
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
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[src]
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[src]
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[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for OmgWtf8
[src]
An OMG-WTF-8 string can be hashed for use in HashMap
and HashSet
.
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'p, 'h> Pattern<&'h OmgWtf8> for &'p OmgWtf8
[src]
type Searcher = OmgWtf8Searcher<'h>
fn into_searcher(self, haystack: &'h OmgWtf8) -> OmgWtf8Searcher<'h>
[src]
fn is_contained_in(self, haystack: H) -> bool
[src]
impl<'h> Haystack for &'h OmgWtf8
[src]
type StartCursor = *const u8
If the haystack is treated as an &[T]
slice, the cursor’s type should be *const T
. Read more
type EndCursor = *const u8
fn cursor_at_front(hs: &Self) -> Self::StartCursor
[src]
fn cursor_at_back(hs: &Self) -> Self::EndCursor
[src]
unsafe fn start_to_end_cursor(
hs: &Self,
cur: Self::StartCursor
) -> Self::EndCursor
[src]
hs: &Self,
cur: Self::StartCursor
) -> Self::EndCursor
unsafe fn end_to_start_cursor(
hs: &Self,
cur: Self::EndCursor
) -> Self::StartCursor
[src]
hs: &Self,
cur: Self::EndCursor
) -> Self::StartCursor
unsafe fn start_cursor_to_offset(hs: &Self, cur: Self::StartCursor) -> usize
[src]
unsafe fn end_cursor_to_offset(hs: &Self, cur: Self::EndCursor) -> usize
[src]
fn is_range_empty(start: Self::StartCursor, end: Self::EndCursor) -> bool
[src]
unsafe fn range_to_self(
_: Self,
start: Self::StartCursor,
end: Self::EndCursor
) -> Self
[src]
_: Self,
start: Self::StartCursor,
end: Self::EndCursor
) -> Self