Struct codeberg_cli::types::config::BergConfig
source · pub struct BergConfig {
pub base_url: String,
pub protocol: String,
pub fancy_tables: bool,
pub no_color: bool,
}
Expand description
Parsed configuration of the berg
client
Fields§
§base_url: String
base url for the forgejo instance that were going to talk to
protocol: String
protocol used, typically only a choice between http/https
fancy_tables: bool
the output of some actions is displayed in a table format. This can optionally be disabled to make the output more machine readable
no_color: bool
the output of some actions is displayed with extra colors in the terminal. This can optionally be disabled in case of e.g. color blindness
WIP this does nothing yet since we don’t have colors anyways yet
Implementations§
source§impl BergConfig
impl BergConfig
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
tries to read berg config from a known set of locations:
The following list is ordered with descending priority
- environment variables of the form “BERG_
” - current directory + “berg.toml”
- data dir + “.berg-cli/berg.toml”“
Note that config options are overridden with these priorities. This implies that if both global and local configs exist, all existing options from the local config override the global configs options. On the other hand, if some options are not overridden, then the global ones are used in this scenario.
pub fn raw() -> Result<Config>
source§impl BergConfig
impl BergConfig
Trait Implementations§
source§impl Clone for BergConfig
impl Clone for BergConfig
source§fn clone(&self) -> BergConfig
fn clone(&self) -> BergConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BergConfig
impl Debug for BergConfig
source§impl Default for BergConfig
impl Default for BergConfig
source§impl<'de> Deserialize<'de> for BergConfig
impl<'de> Deserialize<'de> for BergConfig
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>,
Auto Trait Implementations§
impl Freeze for BergConfig
impl RefUnwindSafe for BergConfig
impl Send for BergConfig
impl Sync for BergConfig
impl Unpin for BergConfig
impl UnwindSafe for BergConfig
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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