pub enum StdForm {
Path,
Url,
MediaType,
RunId,
TaskPath,
}Expand description
A std type over Text whose values are held to a form of their own.
Variants§
Path
path.Path: any text names a path, in its normal form.
Url
url.Url: a URI by RFC 3986, in the normal form of its §6.2.2.
MediaType
media.MediaType: a media type by RFC 9110, in its normal form.
RunId
code.RunId: a run’s id, 32 lowercase hexadecimal digits
(history.md, Keys), its own normal form.
TaskPath
code.TaskPath: a task’s id, root and then / and a positive count
any number of times (history.md, Identity), its own normal form.
Implementations§
Source§impl StdForm
impl StdForm
Sourcepub fn of(decl: &Decl) -> Option<StdForm>
pub fn of(decl: &Decl) -> Option<StdForm>
The form of its own decl’s values are held to, when it is one of
the std types that have one (stdlib.md, @lang
declarations): JSON decoding reads any spelling of the form as the
one value it denotes, and binary decoding accepts only the normal
text (abi.md, Decoding). It is known by its std identity alone.
Sourcepub fn normal(self, text: &str) -> Option<String>
pub fn normal(self, text: &str) -> Option<String>
The normal text of the value text spells, or None when it spells
none.
Sourcepub fn make(self, text: &str) -> Option<Value>
pub fn make(self, text: &str) -> Option<Value>
The value of this form text spells, held as its normal text, or
None when it spells none: the one way std makes a value of it, so
every value of a form is in it and StdForm::out_of finds nothing
in what a run made.
Sourcepub fn refusal(self, text: &str) -> Option<String>
pub fn refusal(self, text: &str) -> Option<String>
Why text is not a value of this form written as its normal text,
or None when it is: the one encoding such a value has (abi.md,
Decoding).
Sourcepub fn out_of(form: Option<StdForm>, value: &Value) -> Option<String>
pub fn out_of(form: Option<StdForm>, value: &Value) -> Option<String>
Why value, a value of a newtype held to form, is out of it, or
None when it is in it or the newtype has no form: the one check
every walker that writes or reads such a value makes, so that no
encoder writes what a decoder refuses.
Sourcepub fn first_out_of(
catalog: &Catalog,
ty: &Type,
value: &Value,
) -> Option<String>
pub fn first_out_of( catalog: &Catalog, ty: &Type, value: &Value, ) -> Option<String>
Why a value value holds anywhere, read at ty, is out of the form
its newtype holds it to, the first in a walk of the value, or None
when every one is in its form: the check a store that keeps such a
value as its erasure, a Text, makes of the whole value, since the
erasure alone cannot tell.