pub struct Field {Show 15 fields
pub attributed_value: Option<ValueUnion>,
pub change_message: Option<String>,
pub currency_code: Option<String>,
pub data_detector_types: Option<Vec<Value>>,
pub date_style: Option<EStyle>,
pub ignores_time_zone: Option<bool>,
pub is_relative: Option<bool>,
pub key: String,
pub label: Option<String>,
pub number_style: Option<NumberStyle>,
pub semantics: Option<Semantics>,
pub text_alignment: Option<TextAlignment>,
pub time_style: Option<EStyle>,
pub value: ValueUnion,
pub row: Option<i32>,
}Expand description
Keys that define an individual field.
Fields§
§attributed_value: Option<ValueUnion>Attributed value of the field. The value may contain HTML markup for links. Only the tag and its href attribute are supported. This key’s value overrides the text specified by the value key. Available in iOS 7.0.
change_message: Option<String>Format string for the alert text that is displayed when the pass is updated. The format string must contain the escape %@, which is replaced with the field’s new value. If you don’t specify a change message, the user isn’t notified when the field changes. Localizable.
currency_code: Option<String>Code of currency
data_detector_types: Option<Vec<Value>>Data detectors that are applied to the field’s value. Provide an empty array to use no data detectors. Data detectors are applied only to back fields.
date_style: Option<EStyle>Style of date to display.
ignores_time_zone: Option<bool>Always display the time and date in the given time zone, not in the user’s current time zone. The format for a date and time always requires a time zone, even if it will be ignored. For backward compatibility with iOS 6, provide an appropriate time zone, so that the information is displayed meaningfully even without ignoring time zones. This key does not affect how relevance is calculated. Available in iOS 7.0.
is_relative: Option<bool>If true, the label’s value is displayed as a relative date; otherwise, it is displayed as an absolute date. This key does not affect how relevance is calculated.
key: StringThe key must be unique within the scope of the entire pass.
label: Option<String>Label text for the field. Localizable.
number_style: Option<NumberStyle>Style of number to display. Number styles have the same meaning as the Cocoa number formatter styles with corresponding names. See https://developer.apple.com/documentation/foundation/nsnumberformatterstyle
semantics: Option<Semantics>Machine-readable metadata to allow the system to offer Wallet passes to users intelligently.
text_alignment: Option<TextAlignment>Alignment for the field’s contents. This key is not allowed for primary fields or back fields.
time_style: Option<EStyle>Style of time to display.
value: ValueUnionValue of the field
row: Option<i32>Row for auxiliary fields. Set to 1 to add an extra row for auxiliary fields.
Implementations§
Source§impl Field
impl Field
Sourcepub fn new_string(key: &str, value: &str) -> Self
pub fn new_string(key: &str, value: &str) -> Self
Create a new Instance with a String value
Sourcepub fn attributed_value(&mut self, attributed_value: ValueUnion)
pub fn attributed_value(&mut self, attributed_value: ValueUnion)
Attributed value of the field. The value may contain HTML markup for links. Only the tag and its href attribute are supported. This key’s value overrides the text specified by the value key. Available in iOS 7.0.
Sourcepub fn change_message(&mut self, change_message: &str)
pub fn change_message(&mut self, change_message: &str)
Format string for the alert text that is displayed when the pass is updated. The format string must contain the escape %@, which is replaced with the field’s new value. If you don’t specify a change message, the user isn’t notified when the field changes. Localizable.
Sourcepub fn currency_code(&mut self, currency_code: &str)
pub fn currency_code(&mut self, currency_code: &str)
Code of currency
Sourcepub fn clear_data_detector_types(&mut self)
pub fn clear_data_detector_types(&mut self)
Data detectors that are applied to the field’s value. Provide an empty array to use no data detectors. Data detectors are applied only to back fields.
Sourcepub fn add_data_detector_type(&mut self, data_detector_type: Value)
pub fn add_data_detector_type(&mut self, data_detector_type: Value)
Data detectors that are applied to the field’s value. Provide an empty array to use no data detectors. Data detectors are applied only to back fields.
Sourcepub fn date_style(&mut self, date_style: EStyle)
pub fn date_style(&mut self, date_style: EStyle)
Style of date to display.
Sourcepub fn ignores_time_zone(&mut self, ignores_time_zone: bool)
pub fn ignores_time_zone(&mut self, ignores_time_zone: bool)
Always display the time and date in the given time zone, not in the user’s current time zone. The format for a date and time always requires a time zone, even if it will be ignored. For backward compatibility with iOS 6, provide an appropriate time zone, so that the information is displayed meaningfully even without ignoring time zones. This key does not affect how relevance is calculated. Available in iOS 7.0.
Sourcepub fn is_relative(&mut self, is_relative: bool)
pub fn is_relative(&mut self, is_relative: bool)
If true, the label’s value is displayed as a relative date; otherwise, it is displayed as an absolute date. This key does not affect how relevance is calculated.
Sourcepub fn number_style(&mut self, number_style: NumberStyle)
pub fn number_style(&mut self, number_style: NumberStyle)
Style of number to display. Number styles have the same meaning as the Cocoa number formatter styles with corresponding names. See https://developer.apple.com/documentation/foundation/nsnumberformatterstyle
Sourcepub fn semantics(&mut self, semantics: Semantics)
pub fn semantics(&mut self, semantics: Semantics)
Machine-readable metadata to allow the system to offer Wallet passes to users intelligently.
Sourcepub fn text_alignment(&mut self, text_alignment: TextAlignment)
pub fn text_alignment(&mut self, text_alignment: TextAlignment)
Alignment for the field’s contents. This key is not allowed for primary fields or back fields.
Sourcepub fn time_style(&mut self, time_style: EStyle)
pub fn time_style(&mut self, time_style: EStyle)
Style of time to display.