A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://doc.rust-lang.org/nightly/std/path/struct.PrefixComponent.html below:

PrefixComponent in std::path - Rust

Struct PrefixComponent1.0.0 · Source
pub struct PrefixComponent<'a> {  }
Expand description

A structure wrapping a Windows path prefix as well as its unparsed string representation.

In addition to the parsed Prefix information returned by kind, PrefixComponent also holds the raw and unparsed OsStr slice, returned by as_os_str.

Instances of this struct can be obtained by matching against the Prefix variant on Component.

Does not occur on Unix.

§Examples
use std::path::{Component, Path, Prefix};
use std::ffi::OsStr;

let path = Path::new(r"c:\you\later\");
match path.components().next().unwrap() {
    Component::Prefix(prefix_component) => {
        assert_eq!(Prefix::Disk(b'C'), prefix_component.kind());
        assert_eq!(OsStr::new("c:"), prefix_component.as_os_str());
    }
    _ => unreachable!(),
}
Source§ 1.0.0 · Source

Returns the parsed prefix data.

See Prefix’s documentation for more information on the different kinds of prefixes.

1.0.0 · Source

Returns the raw OsStr slice for this prefix.

1.0.0 · Source§ 1.0.0 · Source§ 1.0.0 · Source§ 1.0.0 · Source§ 1.0.0 · Source§ Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

1.0.0 · Source§ Source§

This method returns an ordering between

self

and

other

values if one exists.

Read more 1.0.0 · Source§

Tests less than (for

self

and

other

) and is used by the

<

operator.

Read more 1.0.0 · Source§

Tests less than or equal to (for

self

and

other

) and is used by the

<=

operator.

Read more 1.0.0 · Source§

Tests greater than (for

self

and

other

) and is used by the

>

operator.

Read more 1.0.0 · Source§

Tests greater than or equal to (for

self

and

other

) and is used by the

>=

operator.

Read more 1.0.0 · Source§ 1.0.0 · Source§

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4