Struct leo_ast::expressions::StructExpression
source · pub struct StructExpression {
pub name: Identifier,
pub members: Vec<StructVariableInitializer>,
pub span: Span,
}Expand description
A struct initialization expression, e.g., Foo { bar: 42, baz }.
Fields§
§name: IdentifierThe name of the structure type to initialize.
members: Vec<StructVariableInitializer>Initializer expressions for each of the fields in the struct.
N.B. Any functions or member constants in the struct definition are excluded from this list.
span: SpanA span from name to }.
Implementations§
source§impl StructExpression
impl StructExpression
sourcepub fn check_record(&self) -> bool
pub fn check_record(&self) -> bool
Returns true if the record has all required fields and visibility.
sourcepub fn to_record_string(&self) -> String
pub fn to_record_string(&self) -> String
Returns the struct as a record interface with visibility.
Trait Implementations§
source§impl Clone for StructExpression
impl Clone for StructExpression
source§fn clone(&self) -> StructExpression
fn clone(&self) -> StructExpression
Returns a copy of the value. Read more
1.0.0 · 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 StructExpression
impl Debug for StructExpression
source§impl<'de> Deserialize<'de> for StructExpression
impl<'de> Deserialize<'de> for StructExpression
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 Display for StructExpression
impl Display for StructExpression
source§impl Node for StructExpression
impl Node for StructExpression
source§impl PartialEq<StructExpression> for StructExpression
impl PartialEq<StructExpression> for StructExpression
source§fn eq(&self, other: &StructExpression) -> bool
fn eq(&self, other: &StructExpression) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for StructExpression
impl Serialize for StructExpression
impl Eq for StructExpression
impl StructuralEq for StructExpression
impl StructuralPartialEq for StructExpression
Auto Trait Implementations§
impl RefUnwindSafe for StructExpression
impl Send for StructExpression
impl Sync for StructExpression
impl Unpin for StructExpression
impl UnwindSafe for StructExpression
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.