Home
last modified time | relevance | path

Searched refs:OsStr (Results 1 – 25 of 71) sorted by relevance

123

/third_party/rust/crates/clap/src/builder/
Dos_str.rs8 pub struct OsStr { struct
12 impl OsStr { impl
21 pub(crate) fn from_ref(name: &std::ffi::OsStr) -> Self { in from_ref()
27 pub(crate) fn from_static_ref(name: &'static std::ffi::OsStr) -> Self { in from_static_ref()
34 pub fn as_os_str(&self) -> &std::ffi::OsStr { in as_os_str() argument
44 impl From<&'_ OsStr> for OsStr { implementation
45 fn from(id: &'_ OsStr) -> Self { in from()
51 impl From<Str> for OsStr { implementation
54 crate::builder::StrInner::Static(s) => Self::from_static_ref(std::ffi::OsStr::new(s)), in from()
55 crate::builder::StrInner::Owned(s) => Self::from_ref(std::ffi::OsStr::new(s.as_ref())), in from()
[all …]
Daction.rs292 pub(crate) fn default_value(&self) -> Option<&'static std::ffi::OsStr> { in default_value() argument
296 Self::SetTrue => Some(std::ffi::OsStr::new("false")), in default_value()
297 Self::SetFalse => Some(std::ffi::OsStr::new("true")), in default_value()
298 Self::Count => Some(std::ffi::OsStr::new("0")), in default_value()
304 pub(crate) fn default_missing_value(&self) -> Option<&'static std::ffi::OsStr> { in default_missing_value() argument
308 Self::SetTrue => Some(std::ffi::OsStr::new("true")), in default_missing_value()
309 Self::SetFalse => Some(std::ffi::OsStr::new("false")), in default_missing_value()
Dstr.rs134 impl AsRef<std::ffi::OsStr> for Str {
136 fn as_ref(&self) -> &std::ffi::OsStr { in as_ref() argument
181 impl PartialEq<std::ffi::OsStr> for Str {
183 fn eq(&self, other: &std::ffi::OsStr) -> bool { in eq()
187 impl PartialEq<Str> for std::ffi::OsStr { implementation
194 impl PartialEq<&'_ std::ffi::OsStr> for Str {
196 fn eq(&self, other: &&std::ffi::OsStr) -> bool { in eq()
200 impl PartialEq<Str> for &'_ std::ffi::OsStr { implementation
Dresettable.rs5 use crate::builder::OsStr;
123 impl IntoResettable<OsStr> for Option<&'static str> {
124 fn into_resettable(self) -> Resettable<OsStr> { in into_resettable() argument
195 impl<I: Into<OsStr>> IntoResettable<OsStr> for I {
196 fn into_resettable(self) -> Resettable<OsStr> { in into_resettable() argument
Darg.rs16 use crate::builder::OsStr;
65 pub(crate) r_ifs: Vec<(Id, OsStr)>,
66 pub(crate) r_ifs_all: Vec<(Id, OsStr)>,
77 pub(crate) default_vals: Vec<OsStr>,
78 pub(crate) default_vals_ifs: Vec<(Id, ArgPredicate, Option<OsStr>)>,
79 pub(crate) default_missing_vals: Vec<OsStr>,
81 pub(crate) env: Option<(OsStr, Option<OsString>)>,
1646 pub fn default_value(mut self, val: impl IntoResettable<OsStr>) -> Self { in default_value()
1662 pub fn default_value_os(self, val: impl Into<OsStr>) -> Self { in default_value_os()
1673 pub fn default_values(mut self, vals: impl IntoIterator<Item = impl Into<OsStr>>) -> Self { in default_values()
[all …]
Darg_predicate.rs1 use crate::builder::OsStr;
12 Equals(OsStr),
15 impl<S: Into<OsStr>> From<S> for ArgPredicate {
Dvalue_parser.rs229 value: &std::ffi::OsStr, in parse_ref() argument
576 value: &std::ffi::OsStr, in parse_ref() argument
605 value: &std::ffi::OsStr, in parse_ref() argument
696 value: &std::ffi::OsStr, in parse_ref() argument
828 value: &std::ffi::OsStr, in parse_ref() argument
867 value: &std::ffi::OsStr, in parse_ref() argument
915 value: &std::ffi::OsStr, in parse_ref() argument
957 value: &std::ffi::OsStr, in parse_ref() argument
1043 value: &std::ffi::OsStr, in parse_ref() argument
1155 value: &std::ffi::OsStr, in parse_ref() argument
[all …]
/third_party/rust/crates/which-rs/src/
Dlib.rs29 use std::ffi::{OsStr, OsString};
56 pub fn which<T: AsRef<OsStr>>(binary_name: T) -> Result<path::PathBuf> { in which()
80 pub fn which_global<T: AsRef<OsStr>>(binary_name: T) -> Result<path::PathBuf> { in which_global()
85 pub fn which_all<T: AsRef<OsStr>>(binary_name: T) -> Result<impl Iterator<Item = path::PathBuf>> { in which_all()
96 pub fn which_all_global<T: AsRef<OsStr>>( in which_all_global()
151 T: AsRef<OsStr>, in which_in()
152 U: AsRef<OsStr>, in which_in() argument
188 T: AsRef<OsStr>, in which_re_in()
204 T: AsRef<OsStr>, in which_in_all()
205 U: AsRef<OsStr>, in which_in_all() argument
[all …]
Dfinder.rs11 use std::ffi::OsStr;
63 T: AsRef<OsStr>, in find()
64 U: AsRef<OsStr>, in find() argument
96 T: AsRef<OsStr>, in find_re()
/third_party/rust/crates/nix/src/sys/
Dutsname.rs4 use std::ffi::OsStr;
15 pub fn sysname(&self) -> &OsStr { in sysname() argument
20 pub fn nodename(&self) -> &OsStr { in nodename() argument
25 pub fn release(&self) -> &OsStr { in release() argument
30 pub fn version(&self) -> &OsStr { in version() argument
35 pub fn machine(&self) -> &OsStr { in machine() argument
41 pub fn domainname(&self) -> &OsStr { in domainname() argument
55 fn cast_and_trim(slice: &[c_char]) -> &OsStr { in cast_and_trim() argument
63 OsStr::from_bytes(bytes) in cast_and_trim()
/third_party/rust/crates/clap/clap_lex/tests/
Dparsed.rs7 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_long_stdio()
19 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_long_no_escape()
31 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_long_no_value()
45 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_long_with_empty_value()
59 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_long_with_value()
73 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_short_stdio()
85 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_short_escape()
97 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_short_long()
109 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in to_short()
123 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in is_negative_number()
[all …]
Dlexer.rs6 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in insert()
7 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("a"))); in insert()
9 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("1"))); in insert()
10 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("2"))); in insert()
11 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("3"))); in insert()
12 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("b"))); in insert()
13 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("c"))); in insert()
Dshorts.rs5 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in iter()
17 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in next_flag()
36 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in next_value_os()
49 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in next_flag_with_value()
63 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in next_flag_with_no_value()
80 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in advance_by_nothing()
94 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in advance_by_something()
108 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in advance_by_out_of_bounds()
122 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in is_not_empty()
133 assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); in is_partial_not_empty()
[all …]
/third_party/rust/crates/os_str_bytes/tests/
Dcommon.rs14 use std::ffi::OsStr;
36 T: 'a + AsRef<OsStr> + OsStrBytes + ?Sized,
37 U: AsRef<OsStr>,
45 pub(crate) fn from_bytes(string: &[u8]) -> Result<Cow<'_, OsStr>> {
46 let os_string = OsStr::from_raw_bytes(string);
55 test_from_bytes::<OsStr, _, _>(&os_string, string.clone());
79 let os_string = OsStr::new(string);
/third_party/rust/crates/os_str_bytes/src/
Dlib.rs185 use std::ffi::OsStr;
313 ) -> result::Result<Cow<'a, OsStr>, imp::EncodingError> in from_raw_bytes() argument
323 fn cow_os_str_into_path(string: Cow<'_, OsStr>) -> Cow<'_, Path> { in cow_os_str_into_path()
426 impl OsStrBytes for OsStr { implementation
455 cow_os_str_into_path(OsStr::assert_from_raw_bytes(string)) in assert_from_raw_bytes()
463 OsStr::from_raw_bytes(string).map(cow_os_str_into_path) in from_raw_bytes()
599 use std::ffi::OsStr;
613 impl Sealed for OsStr {} implementation
/third_party/rust/crates/os_str_bytes/src/windows/
Dmod.rs7 use std::ffi::OsStr;
79 fn to_bytes(os_string: &OsStr) -> Vec<u8> { in to_bytes()
87 pub(super) fn os_str_from_bytes(string: &[u8]) -> Result<Cow<'_, OsStr>> { in os_str_from_bytes() argument
91 Cow::Borrowed(OsStr::new(unsafe { in os_str_from_bytes()
98 pub(super) fn os_str_to_bytes(os_string: &OsStr) -> Cow<'_, [u8]> { in os_str_to_bytes()
/third_party/rust/crates/os_str_bytes/src/wasm/
Dmod.rs3 use std::ffi::OsStr;
42 pub(super) fn os_str_from_bytes(string: &[u8]) -> Result<Cow<'_, OsStr>> { in os_str_from_bytes() argument
43 from_bytes(string).map(|x| Cow::Borrowed(OsStr::new(x))) in os_str_from_bytes()
46 pub(super) fn os_str_to_bytes(os_string: &OsStr) -> Cow<'_, [u8]> { in os_str_to_bytes()
/third_party/rust/crates/os_str_bytes/
DREADME.md1 # OsStr Bytes
3 This crate allows interacting with the data stored by [`OsStr`] and
8 Typically, the only way to losslessly construct [`OsStr`] or [`OsString`] from
9 a byte sequence is to use `OsStr::new(str::from_utf8(bytes)?)`, which requires
101 [`OsStr`]: https://doc.rust-lang.org/std/ffi/struct.OsStr.html
/third_party/rust/crates/os_str_bytes/src/common/
Dmod.rs3 use std::ffi::OsStr;
29 pub(super) fn os_str_from_bytes(string: &[u8]) -> Result<Cow<'_, OsStr>> { in os_str_from_bytes() argument
33 pub(super) fn os_str_to_bytes(os_string: &OsStr) -> Cow<'_, [u8]> { in os_str_to_bytes()
/third_party/rust/crates/nix/src/
Dlib.rs157 use std::ffi::{CStr, CString, OsStr};
198 NixPath::is_empty(OsStr::new(self)) in is_empty()
202 NixPath::len(OsStr::new(self)) in len()
209 OsStr::new(self).with_nix_path(f) in with_nix_path()
213 impl NixPath for OsStr { implementation
/third_party/rust/crates/cxx/gen/build/src/
Dpaths.rs3 use std::ffi::OsStr;
31 fn with_appended_extension(&self, suffix: impl AsRef<OsStr>) -> PathBuf; in with_appended_extension()
35 fn with_appended_extension(&self, suffix: impl AsRef<OsStr>) -> PathBuf { in with_appended_extension()
/third_party/rust/crates/clap/src/
Dmkeymap.rs4 use crate::builder::OsStr;
27 Long(OsStr),
64 impl PartialEq<OsStr> for KeyType {
65 fn eq(&self, rhs: &OsStr) -> bool { in eq()
/third_party/rust/crates/syn/tests/crates/
Dmain.rs18 use std::ffi::OsStr;
35 if path.extension() == Some(OsStr::new("crate")) { in main()
72 if path.extension() != Some(OsStr::new("rs")) { in parse()
/third_party/rust/crates/rustix/tests/path/
Darg.rs7 use std::ffi::{OsStr, OsString};
27 let t: &OsStr = OsStr::new("hello"); in test_arg()
96 let t: Cow<'_, OsStr> = Cow::Borrowed(OsStr::new("hello")); in test_arg()
102 let t: Cow<'_, OsStr> = Cow::Owned(OsString::from("hello".to_owned())); in test_arg()
/third_party/rust/crates/clap/clap_lex/src/
Dlib.rs110 use std::ffi::OsStr;
185 pub fn next_os(&self, cursor: &mut ArgCursor) -> Option<&OsStr> { in next_os() argument
197 pub fn peek_os(&self, cursor: &ArgCursor) -> Option<&OsStr> { in peek_os() argument
214 pub fn remaining(&self, cursor: &mut ArgCursor) -> impl Iterator<Item = &OsStr> { in remaining()
281 fn new(inner: &'s OsStr) -> Self { in new()

123