Struct move_ir_types::ast::StructDefinition_
source · [−]pub struct StructDefinition_ {
pub abilities: BTreeSet<Ability>,
pub name: StructName,
pub type_formals: Vec<StructTypeParameter>,
pub fields: StructDefinitionFields,
pub invariants: Vec<Invariant>,
}
Expand description
A Move struct
Fields
abilities: BTreeSet<Ability>
The declared abilities for the struct
name: StructName
Human-readable name for the struct that also serves as a nominal type
type_formals: Vec<StructTypeParameter>
The list of formal type arguments
fields: StructDefinitionFields
the fields each instance has
invariants: Vec<Invariant>
the invariants for this struct
Implementations
sourceimpl StructDefinition_
impl StructDefinition_
sourcepub fn move_declared(
abilities: BTreeSet<Ability>,
name: Symbol,
type_formals: Vec<StructTypeParameter>,
fields: Fields<Type>,
invariants: Vec<Invariant>
) -> Self
pub fn move_declared(
abilities: BTreeSet<Ability>,
name: Symbol,
type_formals: Vec<StructTypeParameter>,
fields: Fields<Type>,
invariants: Vec<Invariant>
) -> Self
Creates a new StructDefinition from the abilities, the string representation of the name, and the user specified fields, a map from their names to their types Does not verify the correctness of any internal properties, e.g. doesn’t check that the fields do not have reference types
Trait Implementations
sourceimpl Clone for StructDefinition_
impl Clone for StructDefinition_
sourcefn clone(&self) -> StructDefinition_
fn clone(&self) -> StructDefinition_
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StructDefinition_
impl Debug for StructDefinition_
sourceimpl Display for StructDefinition_
impl Display for StructDefinition_
sourceimpl PartialEq<StructDefinition_> for StructDefinition_
impl PartialEq<StructDefinition_> for StructDefinition_
sourcefn eq(&self, other: &StructDefinition_) -> bool
fn eq(&self, other: &StructDefinition_) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &StructDefinition_) -> bool
fn ne(&self, other: &StructDefinition_) -> bool
This method tests for !=
.
impl StructuralPartialEq for StructDefinition_
Auto Trait Implementations
impl RefUnwindSafe for StructDefinition_
impl Send for StructDefinition_
impl Sync for StructDefinition_
impl Unpin for StructDefinition_
impl UnwindSafe for StructDefinition_
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more