Skip to main content

FieldType

Enum FieldType 

Source
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

Source

pub const fn is_any(&self) -> bool

Whether it describes no type: any value.

Source

pub const fn is_outbox(&self) -> bool

Whether it is an outbox.

Source

pub const fn is_reactions(&self) -> bool

Whether it is the platform’s reactions.

Source

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.

Source

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.

Source

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 Clone for FieldType

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FieldType

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FieldType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for FieldType

Source§

impl PartialEq for FieldType

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FieldType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FieldType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more