pub struct PropertySource { /* private fields */ }Expand description
Property source 属性源
Equivalent to Spring’s PropertySource.
等价于Spring的PropertySource。
Represents a source of configuration properties with a name and priority. 表示具有名称和优先级的配置属性源。
Implementations§
Source§impl PropertySource
impl PropertySource
Sourcepub fn with_map(name: impl Into<String>, map: HashMap<String, Value>) -> Self
pub fn with_map(name: impl Into<String>, map: HashMap<String, Value>) -> Self
Create with map 使用映射创建
Sourcepub fn properties(&self) -> &IndexMap<String, Value>
pub fn properties(&self) -> &IndexMap<String, Value>
Get all properties 获取所有属性
Sourcepub fn source_type(&self) -> PropertySourceType
pub fn source_type(&self) -> PropertySourceType
Get source type 获取源类型
Sourcepub fn set_file_path(&mut self, path: PathBuf)
pub fn set_file_path(&mut self, path: PathBuf)
Set file path 设置文件路径
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Check if contains key 检查是否包含键
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>
Iterate over all properties 遍历所有属性
Sourcepub fn merge(&mut self, other: PropertySource)
pub fn merge(&mut self, other: PropertySource)
Merge another property source into this one 合并另一个属性源到此属性源
Trait Implementations§
Source§impl Clone for PropertySource
impl Clone for PropertySource
Source§fn clone(&self) -> PropertySource
fn clone(&self) -> PropertySource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PropertySource
impl Debug for PropertySource
Auto Trait Implementations§
impl Freeze for PropertySource
impl RefUnwindSafe for PropertySource
impl Send for PropertySource
impl Sync for PropertySource
impl Unpin for PropertySource
impl UnsafeUnpin for PropertySource
impl UnwindSafe for PropertySource
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