Struct garden::model::ApplicationContext
source · pub struct ApplicationContext {
pub options: MainOptions,
/* private fields */
}
Fields§
§options: MainOptions
Implementations§
source§impl ApplicationContext
impl ApplicationContext
sourcepub fn new(options: MainOptions) -> Self
pub fn new(options: MainOptions) -> Self
Construct an empty ApplicationContext. Initialization must be performed post-construction.
sourcepub fn from_options(options: &MainOptions) -> Result<Self, GardenError>
pub fn from_options(options: &MainOptions) -> Result<Self, GardenError>
Initialize an ApplicationContext and Configuration from cli::MainOptions.
sourcepub fn from_path_and_root(
path: &dyn AsRef<Path>,
root: Option<&Path>
) -> Result<Self, GardenError>
pub fn from_path_and_root( path: &dyn AsRef<Path>, root: Option<&Path> ) -> Result<Self, GardenError>
Construct an ApplicationContext from a path and root using default MainOptions.
sourcepub fn from_path(path: &dyn AsRef<Path>) -> Result<Self, GardenError>
pub fn from_path(path: &dyn AsRef<Path>) -> Result<Self, GardenError>
Construct an ApplicationContext from a path using default MainOptions.
sourcepub fn from_path_string(path: &str) -> Result<Self, GardenError>
pub fn from_path_string(path: &str) -> Result<Self, GardenError>
Construct an ApplicationContext from a path using default MainOptions.
sourcepub fn from_string(string: &str) -> Result<Self, GardenError>
pub fn from_string(string: &str) -> Result<Self, GardenError>
Construct an ApplicationContext from a string using default MainOptions.
pub fn get_config(&self, id: ConfigId) -> &Configuration
pub fn get_root_id(&self) -> ConfigId
pub fn get_root_config(&self) -> &Configuration
Trait Implementations§
source§impl Clone for ApplicationContext
impl Clone for ApplicationContext
source§fn clone(&self) -> ApplicationContext
fn clone(&self) -> ApplicationContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ApplicationContext
impl Debug for ApplicationContext
Auto Trait Implementations§
impl !Freeze for ApplicationContext
impl !RefUnwindSafe for ApplicationContext
impl Send for ApplicationContext
impl !Sync for ApplicationContext
impl Unpin for ApplicationContext
impl UnwindSafe for ApplicationContext
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more