Skip to main content

AppAllConfig

Struct AppAllConfig 

Source
pub struct AppAllConfig {
    pub toml_value: Value,
}
Expand description

全局配置文件

Fields§

§toml_value: Value

Implementations§

Source§

impl AppAllConfig

Source

pub fn new<P: Into<PathBuf>>(config_path: Option<P>) -> Self

Source

pub fn get<T: DeserializeOwned>(&self, key: &str) -> Option<T>

Source

pub fn get_or_default<T: DeserializeOwned>(&self, key: &str, default: T) -> T

Source

pub fn get_value(&self, key: &str) -> Option<&Value>

Trait Implementations§

Source§

impl CompInit for AppAllConfig

Source§

fn inner_init(&mut self, ctx: &mut BuildContext) -> RIE<()>

组件内部初始化方法 Read more
Source§

fn init(ctx: &mut BuildContext) -> RIE<()>

同步初始化方法
Source§

fn async_init(ctx: &mut BuildContext) -> BoxFuture<'static, RIE<()>>

异步初始化方法
Source§

fn init_sort() -> i32

初始化排序方法
Source§

impl ComponentDescriptor for AppAllConfig

Source§

const DEP_IDS: &'static [fn() -> TypeId]

组件的依赖列表,存储为返回 TypeId 的函数指针数组。 Read more
Source§

const SCOPE: Scope = Scope::Singleton

组件的作用域,决定实例的生命周期和共享策略。 Read more
Source§

fn build(_ctx: &mut BuildContext) -> Self

构建组件实例。 Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.