pub enum GoExpression {
Primitive(GoPrimitive),
Pointer(Box<GoExpression>),
Slice(Box<GoExpression>),
Map {
key: Box<GoExpression>,
value: Box<GoExpression>,
},
Reference(String),
Interface(String),
Function {
params: Vec<GoExpression>,
returns: Vec<GoExpression>,
},
Any,
OptionalNullable(Box<GoExpression>),
}Expand description
Go type expression
Variants§
Primitive(GoPrimitive)
Primitive type
Pointer(Box<GoExpression>)
Pointer type (*T)
Slice(Box<GoExpression>)
Slice type ([]T)
Map
Map type (map[K]V)
Reference(String)
Struct reference
Interface(String)
Interface reference
Function
Function type
Any
Interface{} (any)
OptionalNullable(Box<GoExpression>)
OptionalNullable[T] type
Implementations§
Source§impl GoExpression
impl GoExpression
Sourcepub fn pointer(inner: GoExpression) -> Self
pub fn pointer(inner: GoExpression) -> Self
Create a pointer to a type
Sourcepub fn slice(inner: GoExpression) -> Self
pub fn slice(inner: GoExpression) -> Self
Create a slice of a type
Sourcepub fn map(key: GoExpression, value: GoExpression) -> Self
pub fn map(key: GoExpression, value: GoExpression) -> Self
Create a map type
Sourcepub fn optional_nullable(inner: GoExpression) -> Self
pub fn optional_nullable(inner: GoExpression) -> Self
Create an OptionalNullable type
Trait Implementations§
Source§impl Clone for GoExpression
impl Clone for GoExpression
Source§fn clone(&self) -> GoExpression
fn clone(&self) -> GoExpression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GoExpression
impl Debug for GoExpression
Source§impl<'de> Deserialize<'de> for GoExpression
impl<'de> Deserialize<'de> for GoExpression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for GoExpression
impl Serialize for GoExpression
Auto Trait Implementations§
impl Freeze for GoExpression
impl RefUnwindSafe for GoExpression
impl Send for GoExpression
impl Sync for GoExpression
impl Unpin for GoExpression
impl UnsafeUnpin for GoExpression
impl UnwindSafe for GoExpression
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