[−][src]Struct sgx_tstd::ffi::OsString
A type that can represent owned, mutable platform-native strings, but is cheaply inter-convertible with Rust strings.
Methods
impl OsString
[src]
pub fn new() -> OsString
[src]
Constructs a new empty OsString
.
pub fn as_os_str(&self) -> &OsStr
[src]
Converts to an OsStr
slice.
pub fn into_string(self) -> Result<String, OsString>
[src]
Converts the OsString
into a String
if it contains valid Unicode data.
On failure, ownership of the original OsString
is returned.
pub fn push<T: AsRef<OsStr>>(&mut self, s: T)
[src]
Extends the string with the given [&OsStr
] slice.
pub fn with_capacity(capacity: usize) -> OsString
[src]
Creates a new OsString
with the given capacity.
The string will be able to hold exactly capacity
lenth units of other
OS strings without reallocating. If capacity
is 0, the string will not
allocate.
pub fn clear(&mut self)
[src]
Truncates the OsString
to zero length.
pub fn capacity(&self) -> usize
[src]
Returns the capacity this OsString
can hold without reallocating.
pub fn reserve(&mut self, additional: usize)
[src]
Reserves capacity for at least additional
more capacity to be inserted
in the given OsString
.
pub fn reserve_exact(&mut self, additional: usize)
[src]
Reserves the minimum capacity for exactly additional
more capacity to
be inserted in the given OsString
. Does nothing if the capacity is
already sufficient.
Note that the allocator may give the collection more space than it requests. Therefore capacity can not be relied upon to be precisely minimal. Prefer reserve if future insertions are expected.
pub fn shrink_to_fit(&mut self)
[src]
Shrinks the capacity of the OsString
to match its length.
pub fn shrink_to(&mut self, min_capacity: usize)
[src]
Shrinks the capacity of the OsString
with a lower bound.
The capacity will remain at least as large as both the length and the supplied value.
Panics if the current capacity is smaller than the supplied minimum capacity.
ⓘImportant traits for Box<F>pub fn into_boxed_os_str(self) -> Box<OsStr>
[src]
Converts this OsString
into a boxed OsStr
.
Methods from Deref<Target = OsStr>
pub fn to_str(&self) -> Option<&str>
[src]
Yields a [&str
] slice if the OsStr
is valid Unicode.
This conversion may entail doing a check for UTF-8 validity.
pub fn to_string_lossy(&self) -> Cow<str>
[src]
Converts an OsStr
to a Cow
<
str
>
.
Any non-Unicode sequences are replaced with U+FFFD REPLACEMENT CHARACTER.
pub fn to_os_string(&self) -> OsString
[src]
Copies the slice into an owned OsString
.
pub fn is_empty(&self) -> bool
[src]
Checks whether the OsStr
is empty.
pub fn len(&self) -> usize
[src]
Returns the length of this OsStr
.
Note that this does not return the number of bytes in this string
as, for example, OS strings on Windows are encoded as a list of u16
rather than a list of bytes. This number is simply useful for passing to
other methods like OsString::with_capacity
to avoid reallocations.
See OsStr
introduction for more information about encoding.
Trait Implementations
impl OsStringExt for OsString
[src]
impl PartialEq<OsString> for OsString
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<str> for OsString
[src]
fn eq(&self, other: &str) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<OsString> for str
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsStr> for OsString
[src]
fn eq(&self, other: &OsStr) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsString> for OsStr
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a OsStr> for OsString
[src]
fn eq(&self, other: &&'a OsStr) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsString> for &'a OsStr
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsString> for Cow<'a, OsStr>
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsString
[src]
fn eq(&self, other: &Cow<'a, OsStr>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsString> for PathBuf
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<PathBuf> for OsString
[src]
fn eq(&self, other: &PathBuf) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsString> for Path
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<Path> for OsString
[src]
fn eq(&self, other: &Path) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsString> for &'a Path
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a Path> for OsString
[src]
fn eq(&self, other: &&'a Path) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<OsString> for Cow<'a, Path>
[src]
fn eq(&self, other: &OsString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'a, Path>> for OsString
[src]
fn eq(&self, other: &Cow<'a, Path>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for OsString
[src]
impl Ord for OsString
[src]
fn cmp(&self, other: &OsString) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialOrd<OsString> for OsString
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
fn lt(&self, other: &OsString) -> bool
[src]
fn le(&self, other: &OsString) -> bool
[src]
fn gt(&self, other: &OsString) -> bool
[src]
fn ge(&self, other: &OsString) -> bool
[src]
impl PartialOrd<str> for OsString
[src]
fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsStr> for OsString
[src]
fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsString> for OsStr
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<&'a OsStr> for OsString
[src]
fn partial_cmp(&self, other: &&'a OsStr) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsString> for &'a OsStr
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsString> for Cow<'a, OsStr>
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsString
[src]
fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsString> for PathBuf
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<PathBuf> for OsString
[src]
fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsString> for Path
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<Path> for OsString
[src]
fn partial_cmp(&self, other: &Path) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsString> for &'a Path
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<&'a Path> for OsString
[src]
fn partial_cmp(&self, other: &&'a Path) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<OsString> for Cow<'a, Path>
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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<'a, 'b> PartialOrd<Cow<'a, Path>> for OsString
[src]
fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>
[src]
#[must_use]
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
#[must_use]
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
#[must_use]
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
#[must_use]
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 OsString
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
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 Deref for OsString
[src]
impl Index<RangeFull> for OsString
[src]
type Output = OsStr
The returned type after indexing.
fn index(&self, _index: RangeFull) -> &OsStr
[src]
impl Debug for OsString
[src]
impl AsRef<OsStr> for OsString
[src]
impl AsRef<Path> for OsString
[src]
impl From<String> for OsString
[src]
impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for OsString
[src]
impl From<Box<OsStr>> for OsString
[src]
impl From<OsString> for Box<OsStr>
[src]
impl From<OsString> for Arc<OsStr>
[src]
impl From<OsString> for Rc<OsStr>
[src]
impl From<OsString> for PathBuf
[src]
impl From<PathBuf> for OsString
[src]
impl Clone for OsString
[src]
fn clone(&self) -> OsString
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for OsString
[src]
impl Borrow<OsStr> for OsString
[src]
Auto Trait Implementations
Blanket Implementations
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.