Struct asn1rs_model::model::Model

source ·
pub struct Model<T: Target> {
    pub name: String,
    pub oid: Option<ObjectIdentifier>,
    pub imports: Vec<Import>,
    pub definitions: Vec<Definition<T::DefinitionType>>,
    pub value_references: Vec<ValueReference<T::ValueReferenceType>>,
}

Fields§

§name: String§oid: Option<ObjectIdentifier>§imports: Vec<Import>§definitions: Vec<Definition<T::DefinitionType>>§value_references: Vec<ValueReference<T::ValueReferenceType>>

Implementations§

source§

impl Model<Protobuf>

source§

impl Model<Rust>

source

pub fn convert_asn_to_rust( asn_model: &Model<Asn>, scope: &[&Model<Asn>], make_names_nice: bool ) -> Model<Rust>

source§

impl Model<Sql>

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn sql_definition_name(name: &str) -> String

source

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

source

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

source

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

source§

impl Model<Asn<Unresolved>>

source§

impl Model<Asn<Unresolved>>

source

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

source§

impl Model<Asn<Resolved>>

source

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

source

pub fn to_rust_keep_names(&self) -> Model<Rust>

source

pub fn to_rust_with_scope(&self, scope: &[&Self]) -> Model<Rust>

source

pub fn to_rust_keep_names_with_scope(&self, scope: &[&Self]) -> Model<Rust>

source§

impl<RS: ResolveState> Model<Asn<RS>>

source

pub fn make_names_nice(&mut self)

Trait Implementations§

source§

impl<T: Clone + Target> Clone for Model<T>where T::DefinitionType: Clone, T::ValueReferenceType: Clone,

source§

fn clone(&self) -> Model<T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T: Debug + Target> Debug for Model<T>where T::DefinitionType: Debug, T::ValueReferenceType: Debug,

source§

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

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

impl<T: Target> Default for Model<T>

source§

fn default() -> Self

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

impl From<Model<Rust>> for RustCodeGenerator

source§

fn from(model: Model<Rust>) -> Self

Converts to this type from the input type.
source§

impl ToProtobufModel for Model<Rust>

source§

impl ToSqlModel for Model<Rust>

source§

fn to_sql(&self) -> Model<Sql>

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.