pub enum Field {
Plain(String),
Secret {
key: String,
},
}Expand description
字段形态(BD-CFG-12/15)。
Field::Plain= 明面值(进文件);Field::Secret= 秘面引用(只有键名,无值)——真值在系统凭据库或 env(BD-CFG-12),文件里落的是secret://ek/<ns>/<key>引用串 (由 ek-cfg 的secret::ref_of单源生成,BD-CFG-13)。
本枚举不含秘值本体(key 只是键名),derive(Debug) 合法;
含真值的类型(ek-cfg SecretValue)按 BD-CFG-18 走手工 Debug。
Variants§
Implementations§
Source§impl Field
impl Field
Sourcepub fn is_plain(&self) -> bool
pub fn is_plain(&self) -> bool
是明面吗。秘面(false)时取引用键走 Self::secret_key。
Sourcepub fn plain_value(&self) -> Option<&str>
pub fn plain_value(&self) -> Option<&str>
明面值借用(None = 秘面)。
Sourcepub fn secret_key(&self) -> Option<&str>
pub fn secret_key(&self) -> Option<&str>
秘面引用键借用(None = 明面)。
Trait Implementations§
impl Eq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe for Field
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