[−][src]Struct cistring::CiString
Implementations
impl CiString
[src]
pub const fn new() -> Self
[src]
pub fn with_capacity(capacity: usize) -> Self
[src]
pub fn from_utf8(vec: Vec<u8>) -> Result<Self, FromUtf8Error>
[src]
pub fn from_utf16(vec: &[u16]) -> Result<Self, FromUtf16Error>
[src]
pub fn from_utf16_lossy(v: &[u16]) -> Self
[src]
pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> Self
[src]
pub fn into_bytes(self) -> Vec<u8>
[src]
pub fn as_str(&self) -> &str
[src]
pub fn as_mut_str(&mut self) -> &str
[src]
pub fn push_str(&mut self, string: &str)
[src]
pub fn capacity(&self) -> usize
[src]
pub fn reserve(&mut self, additional: usize)
[src]
pub fn reserve_exact(&mut self, additional: usize)
[src]
pub fn shrink_to_fit(&mut self)
[src]
pub fn push(&mut self, ch: char)
[src]
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn truncate(&mut self, new_len: usize)
[src]
pub fn pop(&mut self) -> Option<char>
[src]
pub fn remove(&mut self, idx: usize) -> char
[src]
pub fn retain<F>(&mut self, f: F) where
F: FnMut(char) -> bool,
[src]
F: FnMut(char) -> bool,
pub fn insert(&mut self, idx: usize, ch: char)
[src]
pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>
[src]
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn split_off(&mut self, at: usize) -> Self
[src]
pub fn clear(&mut self)
[src]
pub fn replace_range<R>(&mut self, range: R, replace_with: &str) where
R: RangeBounds<usize>,
[src]
R: RangeBounds<usize>,
pub fn into_boxed_str(self) -> Box<str>
[src]
Methods from Deref<Target = String>
pub fn as_str(&self) -> &str
1.7.0[src]
Extracts a string slice containing the entire String
.
Examples
Basic usage:
let s = String::from("foo"); assert_eq!("foo", s.as_str());
pub fn capacity(&self) -> usize
1.0.0[src]
Returns this String
's capacity, in bytes.
Examples
Basic usage:
let s = String::with_capacity(10); assert!(s.capacity() >= 10);
pub fn as_bytes(&self) -> &[u8]
1.0.0[src]
Returns a byte slice of this String
's contents.
The inverse of this method is from_utf8
.
Examples
Basic usage:
let s = String::from("hello"); assert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());
pub fn len(&self) -> usize
1.0.0[src]
Returns the length of this String
, in bytes, not char
s or
graphemes. In other words, it may not be what a human considers the
length of the string.
Examples
Basic usage:
let a = String::from("foo"); assert_eq!(a.len(), 3); let fancy_f = String::from("ƒoo"); assert_eq!(fancy_f.len(), 4); assert_eq!(fancy_f.chars().count(), 3);
pub fn is_empty(&self) -> bool
1.0.0[src]
Returns true
if this String
has a length of zero, and false
otherwise.
Examples
Basic usage:
let mut v = String::new(); assert!(v.is_empty()); v.push('a'); assert!(!v.is_empty());
Trait Implementations
impl AsRef<str> for CiString
[src]
impl Borrow<str> for CiString
[src]
impl Clone for CiString
[src]
impl Debug for CiString
[src]
impl Default for CiString
[src]
impl Deref for CiString
[src]
impl Display for CiString
[src]
impl Eq for CiString
[src]
impl<'_> From<&'_ str> for CiString
[src]
impl From<String> for CiString
[src]
impl FromStr for CiString
[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for CiString
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<String> for CiString
[src]
impl Ord for CiString
[src]
fn cmp(&self, other: &CiString) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'_> PartialEq<&'_ str> for CiString
[src]
impl PartialEq<CiString> for CiString
[src]
impl PartialEq<CiString> for String
[src]
impl PartialEq<String> for CiString
[src]
impl PartialOrd<CiString> for CiString
[src]
fn partial_cmp(&self, other: &CiString) -> Option<Ordering>
[src]
fn lt(&self, other: &CiString) -> bool
[src]
fn le(&self, other: &CiString) -> bool
[src]
fn gt(&self, other: &CiString) -> bool
[src]
fn ge(&self, other: &CiString) -> bool
[src]
impl StructuralEq for CiString
[src]
Auto Trait Implementations
impl RefUnwindSafe for CiString
impl Send for CiString
impl Sync for CiString
impl Unpin for CiString
impl UnwindSafe for CiString
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,