Struct asn1rs::model::Model

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

Fields§

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

Implementations§

source§

impl Model<Protobuf>

source§

impl Model<Rust>

source

pub fn convert_asn_to_rust( asn_model: &Model<Asn<Resolved>>, scope: &[&Model<Asn<Resolved>>], 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>, Global> )

source

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

source

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

source

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

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§

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: &[&Model<Asn<Resolved>>]) -> Model<Rust>

source

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

source§

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

source

pub fn make_names_nice(&mut self)

Trait Implementations§

source§

impl<T> Clone for Model<T>where T: Clone + Target, <T as Target>::DefinitionType: Clone, <T as Target>::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 for Model<T>where T: Debug + Target, <T as Target>::DefinitionType: Debug, <T as Target>::ValueReferenceType: Debug,

source§

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

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

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

source§

fn default() -> Model<T>

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

impl From<Model<Rust>> for RustCodeGenerator

source§

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

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> 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 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> Same<T> for T

§

type Output = T

Should always be Self
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.
§

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

§

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