#[repr(C)]pub struct AString { /* private fields */ }
Expand description
Represents ANSI string.
Implementations§
Source§impl AString
impl AString
Sourcepub fn as_bytes_with_nul(&self) -> &[u8] ⓘ
pub fn as_bytes_with_nul(&self) -> &[u8] ⓘ
Returns &[u8]
.
pub fn as_c_str(&self) -> &AStr
Sourcepub fn as_mut_c_str(&mut self) -> &mut AStr
pub fn as_mut_c_str(&mut self) -> &mut AStr
Returns &mut AStr
.
Sourcepub unsafe fn new_unchecked<T: Into<Vec<u8>>>(v: T) -> Self
pub unsafe fn new_unchecked<T: Into<Vec<u8>>>(v: T) -> Self
Sourcepub unsafe fn new_nul_unchecked<T: Into<Vec<u8>>>(v: T) -> Self
pub unsafe fn new_nul_unchecked<T: Into<Vec<u8>>>(v: T) -> Self
Sourcepub fn from_str(x: &str) -> ConvertResult<Self>
pub fn from_str(x: &str) -> ConvertResult<Self>
Sourcepub fn from_str_lossy(x: &str) -> Self
pub fn from_str_lossy(x: &str) -> Self
Sourcepub unsafe fn clone_from_raw(ptr: *mut u8) -> Self
pub unsafe fn clone_from_raw(ptr: *mut u8) -> Self
Sourcepub unsafe fn clone_from_raw_s(ptr: *mut u8, len: usize) -> Self
pub unsafe fn clone_from_raw_s(ptr: *mut u8, len: usize) -> Self
Methods from Deref<Target = AStr>§
pub fn as_ptr(&self) -> *const i8
pub fn as_u8_ptr(&self) -> *const u8
pub fn to_bytes_with_nul(&self) -> &[u8] ⓘ
pub fn to_bytes(&self) -> &[u8] ⓘ
Sourcepub fn try_to_string(&self) -> ConvertResult<String>
pub fn try_to_string(&self) -> ConvertResult<String>
Sourcepub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
Sourcepub fn to_astring(&self) -> AString
pub fn to_astring(&self) -> AString
Sourcepub fn to_wstring(&self) -> ConvertResult<WString>
pub fn to_wstring(&self) -> ConvertResult<WString>
Returns ConvertError::ConvertToUnicodeError
if an input cannot be converted to a wide char.
§Example
use windy::{AString, WString};
let s = WString::from_str("test").unwrap();
let s2 = AString::from_str("test").unwrap().to_wstring().unwrap();
assert_eq!(s, s2);
Trait Implementations§
Source§impl Ord for AString
impl Ord for AString
Source§impl PartialOrd for AString
impl PartialOrd for AString
impl Eq for AString
impl StructuralPartialEq for AString
Auto Trait Implementations§
impl Freeze for AString
impl RefUnwindSafe for AString
impl Send for AString
impl Sync for AString
impl Unpin for AString
impl UnwindSafe for AString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more