Struct sea_orm_codegen::ActiveEnum
source · pub struct ActiveEnum { /* private fields */ }Implementations§
source§impl ActiveEnum
impl ActiveEnum
sourcepub fn impl_active_enum(
&self,
with_serde: &WithSerde,
with_copy_enums: bool
) -> TokenStream
pub fn impl_active_enum(
&self,
with_serde: &WithSerde,
with_copy_enums: bool
) -> TokenStream
Examples found in repository?
src/entity/writer.rs (line 229)
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
pub fn write_sea_orm_active_enums(
&self,
with_serde: &WithSerde,
with_copy_enums: bool,
) -> OutputFile {
let mut lines = Vec::new();
Self::write_doc_comment(&mut lines);
Self::write(&mut lines, vec![Self::gen_import(with_serde)]);
lines.push("".to_owned());
let code_blocks = self
.enums
.iter()
.map(|(_, active_enum)| active_enum.impl_active_enum(with_serde, with_copy_enums))
.collect();
Self::write(&mut lines, code_blocks);
OutputFile {
name: "sea_orm_active_enums.rs".to_owned(),
content: lines.join("\n"),
}
}Trait Implementations§
source§impl Clone for ActiveEnum
impl Clone for ActiveEnum
source§fn clone(&self) -> ActiveEnum
fn clone(&self) -> ActiveEnum
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 more