pub enum PythonRowType {
Dataclass,
Pydantic,
Msgspec,
}Expand description
Supported Python row type styles for generated code.
Variants§
Implementations§
Source§impl PythonRowType
impl PythonRowType
Sourcepub fn from_option(value: &str) -> Result<Self, ScytheError>
pub fn from_option(value: &str) -> Result<Self, ScytheError>
Parse a row_type option string into a PythonRowType.
Sourcepub fn import_line(self) -> &'static str
pub fn import_line(self) -> &'static str
Returns the import line for the row type.
Sourcepub fn is_stdlib_import(self) -> bool
pub fn is_stdlib_import(self) -> bool
Whether the row type import is a stdlib import (vs third-party).
Sourcepub fn sorted_third_party_imports(self, library_import: &str) -> String
pub fn sorted_third_party_imports(self, library_import: &str) -> String
Build a sorted third-party import block combining the row type import with the given library import line.
isort rules: bare import statements come before from statements,
both groups sorted by module name.
Trait Implementations§
Source§impl Clone for PythonRowType
impl Clone for PythonRowType
Source§fn clone(&self) -> PythonRowType
fn clone(&self) -> PythonRowType
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 PythonRowType
impl Debug for PythonRowType
Source§impl Default for PythonRowType
impl Default for PythonRowType
Source§fn default() -> PythonRowType
fn default() -> PythonRowType
Returns the “default value” for a type. Read more
Source§impl PartialEq for PythonRowType
impl PartialEq for PythonRowType
impl Copy for PythonRowType
impl Eq for PythonRowType
impl StructuralPartialEq for PythonRowType
Auto Trait Implementations§
impl Freeze for PythonRowType
impl RefUnwindSafe for PythonRowType
impl Send for PythonRowType
impl Sync for PythonRowType
impl Unpin for PythonRowType
impl UnsafeUnpin for PythonRowType
impl UnwindSafe for PythonRowType
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