Skip to main content

NamedTypeFragment

Enum NamedTypeFragment 

Source
pub enum NamedTypeFragment {
    Record(RecordTypeFragment),
    Enum(EnumTypeFragment),
    Newtype {
        source_key: TypeSourceKey,
        name: SchemaName,
        inner: FieldType,
    },
    List {
        source_key: TypeSourceKey,
        name: SchemaName,
        item: FieldType,
    },
    Set {
        source_key: TypeSourceKey,
        name: SchemaName,
        item: FieldType,
    },
    Map {
        source_key: TypeSourceKey,
        name: SchemaName,
        key: FieldType,
        value: FieldType,
    },
    Tuple {
        source_key: TypeSourceKey,
        name: SchemaName,
        members: Vec<TupleElementFragment>,
    },
}
Expand description

Named reusable type definition.

Variants§

§

Record(RecordTypeFragment)

Record type.

§

Enum(EnumTypeFragment)

Enum type.

§

Newtype

Transparent named wrapper.

Fields

§source_key: TypeSourceKey

Typed proposal key derived from the current name.

§name: SchemaName

Current schema name.

§inner: FieldType

Wrapped logical type.

§

List

Homogeneous ordered collection.

Fields

§source_key: TypeSourceKey

Typed proposal key derived from the current name.

§name: SchemaName

Current schema name.

§item: FieldType

Element type.

§

Set

Homogeneous unique collection.

Fields

§source_key: TypeSourceKey

Typed proposal key derived from the current name.

§name: SchemaName

Current schema name.

§item: FieldType

Element type.

§

Map

Homogeneous key/value collection.

Fields

§source_key: TypeSourceKey

Typed proposal key derived from the current name.

§name: SchemaName

Current schema name.

§key: FieldType

Key type.

§value: FieldType

Value type.

§

Tuple

Ordered heterogeneous product.

Fields

§source_key: TypeSourceKey

Typed proposal key derived from the current name.

§name: SchemaName

Current schema name.

§members: Vec<TupleElementFragment>

Ordered member types.

Implementations§

Source§

impl NamedTypeFragment

Source

pub fn newtype(name: SchemaName, inner: FieldType) -> Self

Construct one transparent named wrapper from its current name.

Source

pub fn list(name: SchemaName, item: FieldType) -> Self

Construct one named ordered collection from its current name.

Source

pub fn set(name: SchemaName, item: FieldType) -> Self

Construct one named unique collection from its current name.

Source

pub fn map(name: SchemaName, key: FieldType, value: FieldType) -> Self

Construct one named key/value collection from its current name.

Source

pub fn tuple(name: SchemaName, members: Vec<TupleElementFragment>) -> Self

Construct one named heterogeneous product from its current name.

Source

pub const fn source_key(&self) -> &TypeSourceKey

Borrow the typed proposal key derived from the current type name.

Source

pub const fn name(&self) -> &SchemaName

Borrow the current type name.

Trait Implementations§

Source§

impl CandidType for NamedTypeFragment

Source§

fn _ty() -> Type

Source§

fn _ty_doc() -> TypeDoc

Source§

fn id() -> TypeId

Source§

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

Source§

fn ty() -> Type

Source§

impl Clone for NamedTypeFragment

Source§

fn clone(&self) -> NamedTypeFragment

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 NamedTypeFragment

Source§

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

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

impl<'de> Deserialize<'de> for NamedTypeFragment

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 NamedTypeFragment

Source§

impl PartialEq for NamedTypeFragment

Source§

fn eq(&self, other: &NamedTypeFragment) -> 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 NamedTypeFragment

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 NamedTypeFragment

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, 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.