pub struct Config {
pub activation: ActivationMode,
pub remote: RemoteConfig,
pub local: LocalConfig,
pub limits: Limits,
pub audit: AuditConfig,
pub guard: GuardConfig,
pub approval: ApprovalConfig,
}Fields§
§activation: ActivationModeWhen the global config alone should make a session remote.
remote: RemoteConfig§local: LocalConfig§limits: Limits§audit: AuditConfig§guard: GuardConfig§approval: ApprovalConfigImplementations§
Source§impl Config
impl Config
pub fn example() -> &'static str
Sourcepub fn load(explicit: Option<&Path>) -> Result<(Self, PathBuf)>
pub fn load(explicit: Option<&Path>) -> Result<(Self, PathBuf)>
Load following the resolution order in the module docs, with the project file looked for in the process’s working directory.
Sourcepub fn load_in(cwd: Option<&Path>, explicit: Option<&Path>) -> Result<Loaded>
pub fn load_in(cwd: Option<&Path>, explicit: Option<&Path>) -> Result<Loaded>
Load following the resolution order, with the project file looked
for in cwd (default: the process’s working directory).
Sourcepub fn parse_project(
text: &str,
base: Option<&Path>,
baseline: Option<&Config>,
) -> Result<(Self, Vec<String>)>
pub fn parse_project( text: &str, base: Option<&Path>, baseline: Option<&Config>, ) -> Result<(Self, Vec<String>)>
Parse a project file living in base, measured against baseline
(the global config, if there is one): settings that would loosen it
are dropped, and each drop is described in the returned notices.
Sourcepub fn parse(text: &str) -> Result<Self>
pub fn parse(text: &str) -> Result<Self>
Parse a config that belongs to no directory: allowed_dirs entries
must be absolute or ~/....
Sourcepub fn parse_at(text: &str, base: Option<&Path>) -> Result<Self>
pub fn parse_at(text: &str, base: Option<&Path>) -> Result<Self>
Parse a config file that lives in base; relative allowed_dirs
entries (".", "assets") are resolved against it.
pub fn global_path() -> PathBuf
pub fn audit_dir(&self) -> PathBuf
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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