pub enum RustType {
}Expand description
Represents a Rust type for code generation
Variants§
Bool
I8
I16
I32
I64
U8
U16
U32
U64
F32
F64
String
Bytes
Decimal
NaiveDate
NaiveDateTime
NaiveTime
Json
Enum(String)
Custom enum type with the enum name
Option(Box<RustType>)
Optional wrapper
Implementations§
Source§impl RustType
impl RustType
Sourcepub fn to_type_string(&self) -> String
pub fn to_type_string(&self) -> String
Get the type string for code generation
Sourcepub fn to_param_type_string(&self) -> String
pub fn to_param_type_string(&self) -> String
Get the type string for function parameters (use references for strings)
Sourcepub fn needs_chrono(&self) -> bool
pub fn needs_chrono(&self) -> bool
Check if this type needs the chrono crate
Sourcepub fn needs_decimal(&self) -> bool
pub fn needs_decimal(&self) -> bool
Check if this type needs the rust_decimal crate
Sourcepub fn needs_serde_json(&self) -> bool
pub fn needs_serde_json(&self) -> bool
Check if this type needs the serde_json crate
Sourcepub fn inner_type(&self) -> &RustType
pub fn inner_type(&self) -> &RustType
Get the inner type if this is an Option
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Check if this is an Option type
Trait Implementations§
impl StructuralPartialEq for RustType
Auto Trait Implementations§
impl Freeze for RustType
impl RefUnwindSafe for RustType
impl Send for RustType
impl Sync for RustType
impl Unpin for RustType
impl UnsafeUnpin for RustType
impl UnwindSafe for RustType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more