pub enum FieldType {
Show 23 variants
Any,
Text,
Secret,
RichText,
Int,
Float,
Bool,
Date,
Time,
Identifier,
Actor,
Resource(String),
Named(String),
Json,
Option(Box<FieldType>),
List(Box<FieldType>),
Set(Box<FieldType>),
Collection(Box<FieldType>),
Map(Box<FieldType>),
Union(Vec<FieldType>),
Reactions,
Outbox(Box<FieldType>),
Duration,
}Expand description
A field’s or value’s type. See the module docs.
Variants§
Any
A value this vocabulary does not describe: any JSON value.
Text
Secret
Text handed over once and kept nowhere: a password, a token, a one-time code. A
parameter’s type, never a stored field’s: what a record keeps of a call whose parameter is
one is its name alone (crate::ParamType::Secret).
RichText
Formatted text that references resources (tilo-doc’s rich text).
Int
Float
Bool
Date
A calendar day, held as ISO text YYYY-MM-DD.
Time
An instant, held as ISO-8601 text.
Identifier
An account of some service, held as its URI (mailto:jane@x.com).
Actor
Who did something: a person or an agent. Surfaces kept before it was
named actor say principal, and changes written under them are still
decided with them.
Resource(String)
A reference to a resource of this kind; of any kind when empty.
Named(String)
A record or enum declared in the surface’s types.
Json
Any JSON value: what an action answers with that no field shape describes (a read’s output, a parsed document).
Option(Box<FieldType>)
A value or none.
List(Box<FieldType>)
Set(Box<FieldType>)
Distinct values.
Collection(Box<FieldType>)
Ordered items, each under an id of its own.
Map(Box<FieldType>)
Values under text keys.
Union(Vec<FieldType>)
A value of any of these types, at least two.
Reactions
The platform’s reactions: changed only by the react and unreact field edits, which store their invoker.
Outbox(Box<FieldType>)
An outbox of these entries: what a change queues there reaches outside the record once delivered.
Duration
A length of time, held as its number of seconds. Not a stored field’s type: a field keeps a number the app reads in its own unit.
Implementations§
Source§impl FieldType
impl FieldType
Sourcepub const fn is_reactions(&self) -> bool
pub const fn is_reactions(&self) -> bool
Whether it is the platform’s reactions.
Sourcepub fn from_rust_text(text: &str) -> Self
pub fn from_rust_text(text: &str) -> Self
The type of a field a surface written before this vocabulary
described by its Rust type’s text (Outbox<Upload>,
ui::tilo_resource::Reactions): what receipt still tells from it.
Sourcepub fn renamed(&self, renames: &BTreeMap<String, String>) -> Self
pub fn renamed(&self, renames: &BTreeMap<String, String>) -> Self
This type with the named types renames maps given their new names:
what a surface does when a record its fields already declared is
named again by a value an action answers with.
Sourcepub fn from_schema(schema: &Value) -> Self
pub fn from_schema(schema: &Value) -> Self
The type of a value of the JSON Schema schema, as far as the schema
tells: what a parameter published only as its schema takes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FieldType
impl<'de> Deserialize<'de> for FieldType
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>,
impl Eq for FieldType
impl StructuralPartialEq for FieldType
Auto Trait Implementations§
impl Forget for FieldType
impl Freeze for FieldType
impl Move for FieldType
impl RefUnwindSafe for FieldType
impl Send for FieldType
impl Sync for FieldType
impl Unpin for FieldType
impl UnsafeUnpin for FieldType
impl UnwindSafe for FieldType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more