unsupported.rs - source
Description: Source of the Rust file `library/std/src/sys/env/unsupported.rs`.

#
std/sys/env/
unsupported.rs

    1use crate::ffi::{OsStr, OsString};
    2use crate::{fmt, io};
    3
    4pub struct Env(!);
    5
    6impl fmt::Debug for Env {
    7    fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
    8        self.0
    9    }
    10}
    11
    12impl Iterator for Env {
    13    type Item = (OsString, OsString);
    14    fn next(&mut self) -> Option<(OsString, OsString)> {
    15        self.0
    16    }
    17}
    18
    19pub fn env() -> Env {
    20    panic!("not supported on this platform")
    21}
    22
    23pub fn getenv(_: &OsStr) -> Option<OsString> {
    24    None
    25}
    26
    27pub unsafe fn setenv(_: &OsStr, _: &OsStr) -> io::Result<()> {
    28    Err(io::const_error!(io::ErrorKind::Unsupported, "cannot set env vars on this platform"))
    29}
    30
    31pub unsafe fn unsetenv(_: &OsStr) -> io::Result<()> {
    32    Err(io::const_error!(io::ErrorKind::Unsupported, "cannot unset env vars on this platform"))
    33}