Union istring::IString
[−]
[src]
pub union IString { // some fields omitted }
Methods
impl IString
[src]
fn new() -> IString
fn with_capacity(capacity: usize) -> IString
unsafe fn as_inline(&mut self) -> &mut Inline
view as Inline.
Panics if the string isn't inlined
unsafe fn as_heap(&mut self) -> &mut Heap
view as Heap.
Panics if the string isn't on the Heap
fn is_inline(&self) -> bool
fn len(&self) -> usize
unsafe fn set_len(&mut self, new_len: usize)
fn capacity(&self) -> usize
fn move_to_heap(&mut self, cap: usize)
un-inline the string and expand the capacity to cap
.
does nothing if it isn't inlined.
panics, if cap
< self.len()
fn shrink(&mut self)
if the strings fits inline, make it inline,
otherwhise shrink the capacity to the self.len()
.
fn as_bytes(&self) -> &[u8]
fn push_str(&mut self, s: &str)
fn from_utf8(vec: Vec<u8>) -> Result<IString, FromUtf8Error>
unsafe fn from_raw_parts(
buf: *mut u8,
length: usize,
capacity: usize
) -> IString
buf: *mut u8,
length: usize,
capacity: usize
) -> IString
unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> String
fn into_bytes(self) -> Vec<u8>
fn as_str(&self) -> &str
fn as_mut_str(&mut self) -> &mut str
fn reserve(&mut self, additional: usize)
fn reserve_exact(&mut self, additional: usize)
fn push(&mut self, ch: char)
fn truncate(&mut self, new_len: usize)
Trait Implementations
impl Drop for IString
[src]
impl Deref for IString
[src]
type Target = str
The resulting type after dereferencing
fn deref(&self) -> &str
The method called to dereference a value
impl Debug for IString
[src]
impl Display for IString
[src]
impl<'a> From<&'a str> for IString
[src]
impl From<String> for IString
[src]
impl Into<String> for IString
[src]
impl Clone for IString
[src]
fn clone(&self) -> IString
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 PartialEq<str> for IString
[src]
fn eq(&self, rhs: &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 str> for IString
[src]
fn eq(&self, rhs: &&'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 PartialEq<String> for IString
[src]
fn eq(&self, rhs: &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 PartialEq for IString
[src]
fn eq(&self, rhs: &IString) -> 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 Eq for IString
[src]
impl PartialOrd for IString
[src]
fn partial_cmp(&self, rhs: &IString) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, rhs: &IString) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, rhs: &IString) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, rhs: &IString) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, rhs: &IString) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for IString
[src]
fn cmp(&self, other: &IString) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
ord_max_min
)Compares and returns the minimum of two values. Read more
impl Write for IString
[src]
fn write_str(&mut self, s: &str) -> Result
Writes a slice of bytes into this writer, returning whether the write succeeded. Read more
fn write_char(&mut self, c: char) -> Result<(), Error>
1.1.0
Writes a [char
] into this writer, returning whether the write succeeded. Read more
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>
1.0.0
Glue for usage of the [write!
] macro with implementors of this trait. Read more
impl Extend<char> for IString
[src]
fn extend<I: IntoIterator<Item = char>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<'a> Extend<&'a char> for IString
[src]
fn extend<I: IntoIterator<Item = &'a char>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<'a> Extend<&'a str> for IString
[src]
fn extend<I: IntoIterator<Item = &'a str>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<'a> Extend<Cow<'a, str>> for IString
[src]
fn extend<I: IntoIterator<Item = Cow<'a, str>>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl Default for IString
[src]
impl Hash for IString
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a> Add<&'a str> for IString
[src]
type Output = IString
The resulting type after applying the +
operator
fn add(self, other: &str) -> IString
The method for the +
operator
impl<'a> AddAssign<&'a str> for IString
[src]
fn add_assign(&mut self, other: &str)
The method for the +=
operator
impl Index<Range<usize>> for IString
[src]
type Output = str
The returned type after indexing
fn index(&self, index: Range<usize>) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeTo<usize>> for IString
[src]
type Output = str
The returned type after indexing
fn index(&self, index: RangeTo<usize>) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeFrom<usize>> for IString
[src]
type Output = str
The returned type after indexing
fn index(&self, index: RangeFrom<usize>) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeFull> for IString
[src]
type Output = str
The returned type after indexing
fn index(&self, _index: RangeFull) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeInclusive<usize>> for IString
[src]
type Output = str
The returned type after indexing
fn index(&self, index: RangeInclusive<usize>) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeToInclusive<usize>> for IString
[src]
type Output = str
The returned type after indexing
fn index(&self, index: RangeToInclusive<usize>) -> &str
The method for the indexing (container[index]
) operation