You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wit-0.3.0-draft/types.wit
+13-14
Original file line number
Diff line number
Diff line change
@@ -107,12 +107,12 @@ interface types {
107
107
/// This type enumerates the different kinds of errors that may occur when
108
108
/// setting or appending to a `fields` resource.
109
109
variantheader-error {
110
-
/// This error indicates that a `field-key` or `field-value` was
110
+
/// This error indicates that a `field-name` or `field-value` was
111
111
/// syntactically invalid when used with an operation that sets headers in a
112
112
/// `fields`.
113
113
invalid-syntax,
114
114
115
-
/// This error indicates that a forbidden `field-key` was used when trying
115
+
/// This error indicates that a forbidden `field-name` was used when trying
116
116
/// to set a header in a `fields`.
117
117
forbidden,
118
118
@@ -132,11 +132,11 @@ interface types {
132
132
immutable,
133
133
}
134
134
135
-
/// Field keys are always strings.
135
+
/// Field names are always strings.
136
136
///
137
137
/// Field keys should always be treated as case insensitive by the `fields`
138
138
/// resource for the purposes of equality checking.
139
-
typefield-key = string;
139
+
typefield-name = string;
140
140
141
141
/// Field values should always be ASCII strings. However, in
142
142
/// reality, HTTP implementations often have to interpret malformed values,
@@ -154,8 +154,7 @@ interface types {
154
154
/// `set`, `append`, and `delete` operations will fail with
155
155
/// `header-error.immutable`.
156
156
///
157
-
/// A `fields` resource should store `field-key`s and `field-value`s in their
158
-
/// original casing used to construct or mutate the `fields` resource. The `fields`
157
+
/// A `fields` resource should store `field-name`s and `field-value`s in their /// original casing used to construct or mutate the `fields` resource. The `fields`
159
158
/// resource should use that original casing when serializing the fields for
160
159
/// transport or when returning them from a method.
161
160
resourcefields {
@@ -181,44 +180,44 @@ interface types {
181
180
/// An error result will be returned if any header or value was
182
181
/// syntactically invalid, or if a header was forbidden.
183
182
from-list:static func(
184
-
entries:list<tuple<field-key,field-value>>
183
+
entries:list<tuple<field-name,field-value>>
185
184
) ->result<fields, header-error>;
186
185
187
186
/// Get all of the values corresponding to a key. If the key is not present
188
187
/// in this `fields`, an empty list is returned. However, if the key is
189
188
/// present but empty, this is represented by a list with one or more
190
189
/// empty field-values present.
191
-
get:func(name:field-key) ->list<field-value>;
190
+
get:func(name:field-name) ->list<field-value>;
192
191
193
192
/// Returns `true` when the key is present in this `fields`. If the key is
194
193
/// syntactically invalid, `false` is returned.
195
-
has:func(name:field-key) ->bool;
194
+
has:func(name:field-name) ->bool;
196
195
197
196
/// Set all of the values for a key. Clears any existing values for that
198
197
/// key, if they have been set.
199
198
///
200
199
/// Fails with `header-error.immutable` if the `fields` are immutable.
0 commit comments