[−][src]Struct short::env_file::Env
Implementations
impl Env
[src]
pub fn update_by_diff(
&mut self,
source_env: &Env,
env_diff: &EnvDiffController
) -> Result<()>
[src]
&mut self,
source_env: &Env,
env_diff: &EnvDiffController
) -> Result<()>
impl Env
[src]
impl Env
[src]
pub fn new(file: PathBuf) -> Self
[src]
pub fn add<N, V>(&mut self, name: N, value: V) where
N: AsRef<str>,
V: AsRef<str>,
[src]
N: AsRef<str>,
V: AsRef<str>,
use crate::short::env_file::Env; let mut env = Env::new("".into()); env.add("var1","test"); if let Ok(var) = env.get("var1") { assert!(true); } else { assert!(false); }
pub fn get<N: AsRef<str>>(&self, name: N) -> Result<&Var>
[src]
use crate::short::env_file::Env; let mut env = Env::new("".into()); env.add("var1","test"); if let Ok(var) = env.get("var1") { assert!(true); } else { assert!(false); } assert!(env.get("var2").is_err());
pub fn is_set<N, V>(&self, name: N, value: V) -> bool where
N: AsRef<str>,
V: AsRef<str>,
[src]
N: AsRef<str>,
V: AsRef<str>,
pub fn add_empty_line(&mut self)
[src]
pub fn from_file_reader<P: AsRef<Path>>(file: P) -> Result<Self>
[src]
pub fn entries_from_reader(
&mut self,
cursor: &mut dyn BufRead
) -> ResultParse<()>
[src]
&mut self,
cursor: &mut dyn BufRead
) -> ResultParse<()>
pub fn set_file(&mut self, file: PathBuf)
[src]
pub fn file(&self) -> &PathBuf
[src]
pub fn file_name(&self) -> Result<String>
[src]
pub fn name(&self) -> Result<String>
[src]
pub fn iter(&self) -> EnvIterator
[src]
pub fn save(&self) -> Result<()>
[src]
pub fn copy(&self, file: PathBuf) -> Self
[src]
Trait Implementations
impl Clone for Env
[src]
impl Debug for Env
[src]
impl Display for Env
[src]
impl Eq for Env
[src]
impl From<PathBuf> for Env
[src]
impl Ord for Env
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Env> for Env
[src]
impl PartialOrd<Env> for Env
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq 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,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,