Lines Matching defs:Cow
13 use alloc::borrow::Cow;
72 /// Returns a potentially-lossy rendering of this string as a `Cow<'_,
74 fn to_string_lossy(&self) -> Cow<'_, str>;
77 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>>;
81 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
99 fn to_string_lossy(&self) -> Cow<'_, str> {
100 Cow::Borrowed(self)
104 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
105 Ok(Cow::Owned(
111 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
115 Ok(Cow::Owned(
137 fn to_string_lossy(&self) -> Cow<'_, str> {
138 Cow::Borrowed(self)
142 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
143 Ok(Cow::Owned(
149 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
173 fn to_string_lossy(&self) -> Cow<'_, str> {
174 Cow::Borrowed(self)
178 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
179 Ok(Cow::Owned(
185 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
189 Ok(Cow::Owned(
212 fn to_string_lossy(&self) -> Cow<'_, str> {
217 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
218 Ok(Cow::Owned(
224 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
228 Ok(Cow::Owned(
251 fn to_string_lossy(&self) -> Cow<'_, str> {
256 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
257 Ok(Cow::Owned(
264 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
289 fn to_string_lossy(&self) -> Cow<'_, str> {
294 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
295 Ok(Cow::Owned(
301 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
305 Ok(Cow::Owned(
328 fn to_string_lossy(&self) -> Cow<'_, str> {
333 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
334 Ok(Cow::Owned(
340 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
344 Ok(Cow::Owned(
370 fn to_string_lossy(&self) -> Cow<'_, str> {
375 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
376 Ok(Cow::Owned(
383 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
408 fn to_string_lossy(&self) -> Cow<'_, str> {
413 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
414 Ok(Cow::Owned(
420 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
424 Ok(Cow::Owned(
449 fn to_string_lossy(&self) -> Cow<'_, str> {
454 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
455 Ok(Cow::Borrowed(self))
459 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
463 Ok(Cow::Borrowed(self))
483 fn to_string_lossy(&self) -> Cow<'_, str> {
488 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
489 Ok(Cow::Borrowed(self))
493 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
497 Ok(Cow::Borrowed(self))
517 fn to_string_lossy(&self) -> Cow<'_, str> {
522 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
523 Ok(Cow::Borrowed(self))
527 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
531 Ok(Cow::Owned(self))
544 impl<'a> Arg for Cow<'a, str> {
551 fn to_string_lossy(&self) -> Cow<'_, str> {
552 Cow::Borrowed(self)
556 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
557 Ok(Cow::Owned(
563 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
567 Ok(Cow::Owned(
569 Cow::Owned(s) => CString::new(s),
570 Cow::Borrowed(s) => CString::new(s),
587 impl<'a> Arg for Cow<'a, OsStr> {
594 fn to_string_lossy(&self) -> Cow<'_, str> {
599 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
600 Ok(Cow::Owned(
606 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
610 Ok(Cow::Owned(
612 Cow::Owned(os) => CString::new(os.into_vec()),
613 Cow::Borrowed(os) => CString::new(os.as_bytes()),
629 impl<'a> Arg for Cow<'a, CStr> {
636 fn to_string_lossy(&self) -> Cow<'_, str> {
642 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
643 Ok(Cow::Borrowed(self))
647 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
672 fn to_string_lossy(&self) -> Cow<'_, str> {
677 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
678 Ok(Cow::Owned(
684 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
688 Ok(Cow::Owned(
711 fn to_string_lossy(&self) -> Cow<'_, str> {
716 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
717 Ok(Cow::Owned(
724 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
728 Ok(Cow::Owned(
752 fn to_string_lossy(&self) -> Cow<'_, str> {
757 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
758 Ok(Cow::Owned(
765 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
769 Ok(Cow::Owned(
792 fn to_string_lossy(&self) -> Cow<'_, str> {
797 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
798 Ok(Cow::Owned(
804 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
808 Ok(Cow::Owned(
830 fn to_string_lossy(&self) -> Cow<'_, str> {
835 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
836 Ok(Cow::Owned(
842 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
846 Ok(Cow::Owned(
868 fn to_string_lossy(&self) -> Cow<'_, str> {
873 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
874 Ok(Cow::Owned(
880 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
884 Ok(Cow::Owned(
907 fn to_string_lossy(&self) -> Cow<'_, str> {
908 Cow::Borrowed(self.as_str())
912 fn as_cow_c_str(&self) -> io::Result<Cow<'_, CStr>> {
913 Ok(Cow::Borrowed(self.as_c_str()))
917 fn into_c_str<'b>(self) -> io::Result<Cow<'b, CStr>>
921 Ok(Cow::Owned(self.as_c_str().to_owned()))