std::path::Prefix

Enum std::path::Prefix

pub enum Prefix<'a> {
    Verbatim(&'a OsStr),
    VerbatimUNC(&'a OsStr, &'a OsStr),
    VerbatimDisk(u8),
    DeviceNS(&'a OsStr),
    UNC(&'a OsStr, &'a OsStr),
    Disk(u8),
}

Windows path prefixes, e.g. C: or \\server\share.

Windows uses a variety of path prefix styles, including references to drive volumes (like C:), network shared folders (like \\server\share), and others. In addition, some path prefixes are "verbatim" (i.e. prefixed with \\?\), in which case / is not treated as a separator and essentially no normalization is performed.

Examples

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

fn get_path_prefix