pub struct CustomType {
    pub ident: TypeIdent,
    pub rs_ty: String,
    pub rs_dependencies: BTreeMap<&'static str, CargoDependency>,
    pub serde_attrs: Vec<String>,
    pub ts_ty: String,
    pub ts_declaration: Option<String>,
}
Expand description

Used for defining type information for types that are defined externally, or that otherwise require custom treatment.

Fields

ident: TypeIdentrs_ty: String

Qualified path to refer to the type in the Rust generators.

rs_dependencies: BTreeMap<&'static str, CargoDependency>

Dependencies to add to the Rust plugin’s Cargo.toml to be able to use the type.

Keys in the map are dependency names as they appear on the left-hand side of the = in the Cargo.toml [dependencies] section, while the value describes what comes on the right-hand side.

serde_attrs: Vec<String>

Serde attributes to add to fields of this type.

ts_ty: String

Name to refer to the type in the TypeScript generator.

ts_declaration: Option<String>

Optional declaration, for when ts_ty does not refer to a built-in type.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.