pub struct JuliaStruct {
pub name: String,
pub type_params: Vec<String>,
pub supertype: Option<String>,
pub is_mutable: bool,
pub fields: Vec<(String, Option<JuliaType>, Option<JuliaExpr>)>,
pub inner_constructors: Vec<JuliaFunction>,
pub doc: Option<String>,
}Expand description
A Julia struct (composite type) definition.
Fields§
§name: StringStruct name
type_params: Vec<String>Type parameters: {T, S}
supertype: Option<String>Supertype: <: AbstractFoo
is_mutable: boolWhether this struct is mutable
fields: Vec<(String, Option<JuliaType>, Option<JuliaExpr>)>Fields: (name, type, optional default)
inner_constructors: Vec<JuliaFunction>Inner constructors
doc: Option<String>Doc string
Implementations§
Source§impl JuliaStruct
impl JuliaStruct
Sourcepub fn with_field(self, name: impl Into<String>, ty: JuliaType) -> Self
pub fn with_field(self, name: impl Into<String>, ty: JuliaType) -> Self
Add a field.
Sourcepub fn with_supertype(self, supertype: impl Into<String>) -> Self
pub fn with_supertype(self, supertype: impl Into<String>) -> Self
Set supertype.
Sourcepub fn with_type_param(self, param: impl Into<String>) -> Self
pub fn with_type_param(self, param: impl Into<String>) -> Self
Add a type parameter.
Trait Implementations§
Source§impl Clone for JuliaStruct
impl Clone for JuliaStruct
Source§fn clone(&self) -> JuliaStruct
fn clone(&self) -> JuliaStruct
Returns a duplicate 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 JuliaStruct
impl Debug for JuliaStruct
Source§impl PartialEq for JuliaStruct
impl PartialEq for JuliaStruct
impl StructuralPartialEq for JuliaStruct
Auto Trait Implementations§
impl Freeze for JuliaStruct
impl RefUnwindSafe for JuliaStruct
impl Send for JuliaStruct
impl Sync for JuliaStruct
impl Unpin for JuliaStruct
impl UnsafeUnpin for JuliaStruct
impl UnwindSafe for JuliaStruct
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