pub struct ValueExtractor;Expand description
Implementations§
Source§impl ValueExtractor
impl ValueExtractor
Sourcepub fn extract<T>(
key: &str,
default: Option<T>,
env: &Environment,
) -> Result<T, ConfigError>
pub fn extract<T>( key: &str, default: Option<T>, env: &Environment, ) -> Result<T, ConfigError>
Extract a value from environment 从环境提取值
Sourcepub fn extract_string(
key: &str,
default: Option<&str>,
env: &Environment,
) -> Result<String, ConfigError>
pub fn extract_string( key: &str, default: Option<&str>, env: &Environment, ) -> Result<String, ConfigError>
Extract string value 提取字符串值
Sourcepub fn extract_bool(
key: &str,
default: Option<bool>,
env: &Environment,
) -> Result<bool, ConfigError>
pub fn extract_bool( key: &str, default: Option<bool>, env: &Environment, ) -> Result<bool, ConfigError>
Extract boolean value 提取布尔值
Sourcepub fn extract_int<T>(
key: &str,
default: Option<T>,
env: &Environment,
) -> Result<T, ConfigError>
pub fn extract_int<T>( key: &str, default: Option<T>, env: &Environment, ) -> Result<T, ConfigError>
Extract integer value 提取整数值
Sourcepub fn parse_placeholder(input: &str) -> (String, Option<String>)
pub fn parse_placeholder(input: &str) -> (String, Option<String>)
Parse placeholder expression (e.g., “${key:default}”) 解析占位符表达式(例如 ${key:default})
Sourcepub fn resolve_placeholder(input: &str, env: &Environment) -> String
pub fn resolve_placeholder(input: &str, env: &Environment) -> String
Resolve placeholder expression with environment 使用环境解析占位符表达式
Auto Trait Implementations§
impl Freeze for ValueExtractor
impl RefUnwindSafe for ValueExtractor
impl Send for ValueExtractor
impl Sync for ValueExtractor
impl Unpin for ValueExtractor
impl UnsafeUnpin for ValueExtractor
impl UnwindSafe for ValueExtractor
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