[][src]Struct reef::Env

pub struct Env {
    pub username: String,
    pub hostname: String,
    pub distro: String,
    pub realname: String,
    pub devicename: String,

Metadata about the environment


username: String

The username

hostname: String

The hostname,

distro: String

The distro

realname: String

The real name for the user

devicename: String

The device name


impl Env[src]

pub fn which(name: &str) -> Result<PathBuf>[src]

uses the PATH environment variable to search for a filename matching the specified name. if a matching filename is not found, it will check for the existence of name.exe and name.bat


use reef::Env;
let git_path = Env::which("git").unwrap();

pub fn shebang(path: &Path) -> Result<String>[src]

extracts the text following the shebang #!


given a file with the contents:


the shebang method will return C:/Ruby26-x64/bin/ruby.exe

use reef::Env;
use std::env;
let path = std::env::temp_dir().join("test.rb");
let target = Env::shebang(&path).unwrap();

Trait Implementations

impl Clone for Env[src]

impl Debug for Env[src]

impl Default for Env[src]

impl<'de> Deserialize<'de> for Env[src]

impl Display for Env[src]

impl Eq for Env[src]

impl<__S> GraphQLType<__S> for Env where
    __S: ScalarValue,
    &'__b __S: ScalarRefValue<'__b>, 

type Context = ()

The expected context type for this GraphQL type Read more

type TypeInfo = ()

Type that may carry additional schema information Read more

impl Hash for Env[src]

impl Ord for Env[src]

impl PartialEq<Env> for Env[src]

impl PartialOrd<Env> for Env[src]

impl Serialize for Env[src]

impl StructuralEq for Env[src]

impl StructuralPartialEq for Env[src]

Auto Trait Implementations

impl RefUnwindSafe for Env

impl Send for Env

impl Sync for Env

impl Unpin for Env

impl UnwindSafe for Env

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,