pub struct ValidationFieldError {
pub error_type: String,
pub field: Option<String>,
pub payload: Option<Value>,
}Expand description
One refused field in a BcsApiError::ValidationError (an entry of errors in the broker’s body).
§Examples
use brokapi_bcs_protocol::error::ValidationFieldError;
let e: ValidationFieldError =
serde_json::from_str(r#"{"type":"INVALID_VALUE","field":"price","payload":{"message":"too low"}}"#)?;
assert_eq!(e.error_type, "INVALID_VALUE");
assert_eq!(e.field.as_deref(), Some("price"));Fields§
§error_type: StringKind of the problem, as the broker names it (JSON field type).
field: Option<String>Name of the request field the problem is about. None if the problem is not about one field.
payload: Option<Value>Extra data of the broker, free-form JSON. The shape depends on error_type.
Trait Implementations§
Source§impl Clone for ValidationFieldError
impl Clone for ValidationFieldError
Source§fn clone(&self) -> ValidationFieldError
fn clone(&self) -> ValidationFieldError
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 ValidationFieldError
impl Debug for ValidationFieldError
Source§impl<'de> Deserialize<'de> for ValidationFieldError
impl<'de> Deserialize<'de> for ValidationFieldError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ValidationFieldError
impl RefUnwindSafe for ValidationFieldError
impl Send for ValidationFieldError
impl Sync for ValidationFieldError
impl Unpin for ValidationFieldError
impl UnsafeUnpin for ValidationFieldError
impl UnwindSafe for ValidationFieldError
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