pub struct RustStruct {
pub name: String,
pub visibility: Visibility,
pub doc_comment: Option<String>,
pub parsed_doc: Option<ParsedDocstring>,
pub generics: Option<String>,
pub fields: Vec<RustField>,
pub derives: Vec<String>,
pub pyclass: Option<PyClassMeta>,
pub source: SourceSpan,
}Expand description
A Rust struct definition
Fields§
§name: String§visibility: Visibility§doc_comment: Option<String>§parsed_doc: Option<ParsedDocstring>§generics: Option<String>Generic parameters as string, e.g. “<T: Clone, const N: usize>”
fields: Vec<RustField>§derives: Vec<String>§pyclass: Option<PyClassMeta>§source: SourceSpanImplementations§
Source§impl RustStruct
impl RustStruct
pub fn with_visibility(self, vis: Visibility) -> Self
pub fn with_doc(self, doc: impl Into<String>) -> Self
pub fn with_generics(self, generics: impl Into<String>) -> Self
pub fn with_field(self, field: RustField) -> Self
pub fn with_derive(self, derive: impl Into<String>) -> Self
pub fn with_pyclass(self, meta: PyClassMeta) -> Self
pub fn with_source(self, source: SourceSpan) -> Self
Trait Implementations§
Source§impl Clone for RustStruct
impl Clone for RustStruct
Source§fn clone(&self) -> RustStruct
fn clone(&self) -> RustStruct
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 RustStruct
impl Debug for RustStruct
Source§impl<'de> Deserialize<'de> for RustStruct
impl<'de> Deserialize<'de> for RustStruct
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
Auto Trait Implementations§
impl Freeze for RustStruct
impl RefUnwindSafe for RustStruct
impl Send for RustStruct
impl Sync for RustStruct
impl Unpin for RustStruct
impl UnsafeUnpin for RustStruct
impl UnwindSafe for RustStruct
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