Struct edm_core::request::Validation
source · pub struct Validation { /* private fields */ }Expand description
记录验证结果中的异常条目
Implementations§
source§impl Validation
impl Validation
sourcepub fn from_entry(key: impl Into<SharedString>, err: impl Into<Error>) -> Self
pub fn from_entry(key: impl Into<SharedString>, err: impl Into<Error>) -> Self
通过键值对创建实例
sourcepub fn add(
&mut self,
key: impl Into<SharedString>,
message: impl Into<SharedString>
)
pub fn add( &mut self, key: impl Into<SharedString>, message: impl Into<SharedString> )
通过错误消息添加验证异常记录
sourcepub fn is_contain_key(&self, key: &str) -> bool
pub fn is_contain_key(&self, key: &str) -> bool
如果包含指定键值的异常数据,则返回 true
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
如果没有任何异常条目,则返回true
sourcepub fn into_json_map(self) -> JsonMap
pub fn into_json_map(self) -> JsonMap
将验证结构转换为 edm-core::JsonMap<String,JsonValue>对象
Trait Implementations§
source§impl Debug for Validation
impl Debug for Validation
source§impl Default for Validation
impl Default for Validation
source§fn default() -> Validation
fn default() -> Validation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Validation
impl Send for Validation
impl Sync for Validation
impl Unpin for Validation
impl UnwindSafe for Validation
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