pub enum DisplayField {
Reference {
reference: String,
path: Option<String>,
params: Option<FormatParams>,
visible: VisibleRule,
},
Group {
field_group: FieldGroup,
},
Scope {
path: Option<String>,
label: Option<String>,
iteration: Iteration,
fields: Vec<DisplayField>,
},
Simple {
path: Option<String>,
label: String,
value: Option<String>,
format: Option<FieldFormat>,
params: Option<FormatParams>,
separator: Option<String>,
visible: VisibleRule,
},
}Expand description
A display field — can be a simple field, a field group, or a reference.
Variants§
Reference
A reference to a definition: { "$ref": "$.display.definitions.foo", "path": "...", ... }.
Per ERC-7730 spec, a reference object carries $ref plus the field’s own
path, optional params (which override definition params), and visible.
Fields
§
params: Option<FormatParams>Params that override/extend the definition’s params.
§
visible: VisibleRuleVisibility rule (from the referencing field).
Group
A grouped set of fields (v2): { "fieldGroup": { ... } }.
Fields
§
field_group: FieldGroupScope
Direct spec group object: { "path": "...", "label": "...", "fields": [...] }.
Simple
A simple field with path, label, format, etc.
Trait Implementations§
Source§impl Clone for DisplayField
impl Clone for DisplayField
Source§fn clone(&self) -> DisplayField
fn clone(&self) -> DisplayField
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 DisplayField
impl Debug for DisplayField
Source§impl<'de> Deserialize<'de> for DisplayField
impl<'de> Deserialize<'de> for DisplayField
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 DisplayField
impl RefUnwindSafe for DisplayField
impl Send for DisplayField
impl Sync for DisplayField
impl Unpin for DisplayField
impl UnsafeUnpin for DisplayField
impl UnwindSafe for DisplayField
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