pub struct Context {
pub working_dir: PathBuf,
pub profile: Profile,
pub symlink: bool,
/* private fields */
}Fields§
§working_dir: PathBuf§profile: Profile§symlink: boolImplementations§
Source§impl Context
impl Context
pub fn get_variable(&self, key: &str) -> Option<&Value>
pub fn get_user_variable(&self, key: &str) -> Option<&Value>
pub fn get_profile_variable(&self, key: &str) -> Option<&Value>
pub fn get_context_variable(&self, key: &str) -> Option<&Value>
pub fn set_profile(&mut self, profile: Profile)
pub fn get_prompted_variables( &mut self, conf: &Config, packages: &Option<Vec<String>>, ) -> Result<Table>
pub fn get_prompts( profile: &Profile, conf: &Config, packages: &Option<Vec<String>>, ) -> HashMap<String, String>
pub fn save_to_uservariables( &mut self, key: &str, val: Value, ) -> Result<(), Error>
pub fn parse_uservariables(cwd: &Path) -> Result<Table, Error>
pub fn new( working_dir: &Path, conf: &Config, profile_name: &Option<String>, create_profile_if_missing: bool, ) -> Result<(Self, bool), Error>
pub fn get_profile_from_config( conf: &Config, pname: &Option<String>, create_if_missing: bool, variables: &Table, ) -> Result<(Profile, bool)>
pub fn get_variables(&self) -> &Table
pub fn get_user_variables(&self) -> &Table
pub fn get_context_variables(&self) -> Table
pub fn extend_variables(&mut self, new_vars: Table)
pub fn print_variables(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more