pub struct GleamElementField {
pub gleam_field: String,
pub kind: String,
pub json_field: Option<String>,
pub default: Option<String>,
pub value: Option<String>,
}Expand description
One field inside a GleamElementConstructor’s argument list.
kind selects the source/encoding strategy:
"file_path"— readjson_fieldfrom the JSON object as a string, prefix with the configuredtest_documents_dirwhen the value does not start with/, and emit as a Gleam string literal."byte_array"— readjson_fieldfrom the JSON object as a JSONArray(Number)and emit as a Gleam BitArray literal<<n1, n2, …>>."string"— readjson_fieldas a string, emit as a Gleam string literal; falls back todefault(or empty) if missing."literal"— emitvalueverbatim (no JSON lookup). Use for constant fields likeconfig: option.None.
Fields§
§gleam_field: StringGleam record field name (e.g. "path", "config").
kind: StringSource/encoding strategy. See struct doc.
json_field: Option<String>JSON object key to read, when kind is one of the JSON-driven
strategies. Required for "file_path", "byte_array", "string";
ignored for "literal".
default: Option<String>Default Gleam expression when json_field is missing/null. Only
honoured by the "string" strategy today.
value: Option<String>Verbatim Gleam expression to emit when kind = "literal".
Trait Implementations§
Source§impl Clone for GleamElementField
impl Clone for GleamElementField
Source§fn clone(&self) -> GleamElementField
fn clone(&self) -> GleamElementField
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 GleamElementField
impl Debug for GleamElementField
Source§impl<'de> Deserialize<'de> for GleamElementField
impl<'de> Deserialize<'de> for GleamElementField
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 GleamElementField
impl RefUnwindSafe for GleamElementField
impl Send for GleamElementField
impl Sync for GleamElementField
impl Unpin for GleamElementField
impl UnsafeUnpin for GleamElementField
impl UnwindSafe for GleamElementField
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