[][src]Struct asn1rs_model::model::Model

pub struct Model<T> {
    pub name: String,
    pub imports: Vec<Import>,
    pub definitions: Vec<Definition<T>>,
}

Fields

name: Stringimports: Vec<Import>definitions: Vec<Definition<T>>

Implementations

impl Model<Protobuf>[src]

impl Model<Rust>[src]

pub fn convert_asn_to_rust(asn_model: &Model<Asn>) -> Model<Rust>[src]

pub fn definition_to_rust(
    name: &str,
    asn: &AsnType,
    defs: &mut Vec<Definition<Rust>>
)
[src]

Converts the given Asn value to Rust, adding new Defintions as necessary (inlined types cannot be represented in rust and thus need to be extracted to their own types). The returned value is what shall be used to reference to the definition and can therefore be used to be inserted in the parent element.

The name is expected in a valid and rusty way

pub fn definition_type_to_rust_type(
    name: &str,
    asn: &AsnType,
    defs: &mut Vec<Definition<Rust>>
) -> RustType
[src]

impl Model<Sql>[src]

pub fn convert_rust_to_sql(rust_model: &Model<Rust>) -> Model<Sql>[src]

pub fn rust_struct_to_sql_table(
    name: &str,
    fields: &[Field],
    definitions: &mut Vec<Definition<Sql>>
)
[src]

pub fn rust_data_enum_to_sql_table(
    name: &str,
    enumeration: &DataEnum,
    definitions: &mut Vec<Definition<Sql>>
)
[src]

pub fn rust_enum_to_sql_enum(
    name: &str,
    enumeration: &PlainEnum,
    definitions: &mut Vec<Definition<Sql>>
)
[src]

pub fn rust_tuple_struct_to_sql_table(
    name: &str,
    rust_inner: &RustType,
    definitions: &mut Vec<Definition<Sql>>
)
[src]

pub fn sql_column_name(name: &str) -> String[src]

pub fn has_no_column_in_embedded_struct(rust: &RustType) -> bool[src]

pub fn is_primitive(rust: &RustType) -> bool[src]

pub fn struct_list_entry_table_name(
    struct_name: &str,
    field_name: &str
) -> String
[src]

impl Model<Asn>[src]

pub fn try_from(value: Vec<Token>) -> Result<Self, Error>[src]

pub fn make_names_nice(&mut self)[src]

pub fn to_rust(&self) -> Model<Rust>[src]

Trait Implementations

impl<T: Clone> Clone for Model<T>[src]

impl<T: Debug> Debug for Model<T>[src]

impl<T> Default for Model<T>[src]

impl ToProtobufModel for Model<Rust>[src]

impl ToSqlModel for Model<Rust>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Model<T> where
    T: RefUnwindSafe

impl<T> Send for Model<T> where
    T: Send

impl<T> Sync for Model<T> where
    T: Sync

impl<T> Unpin for Model<T> where
    T: Unpin

impl<T> UnwindSafe for Model<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.