(self)
| 1650 | return lines |
| 1651 | |
| 1652 | def generate_fory_helpers(self) -> List[str]: |
| 1653 | lines: List[str] = [] |
| 1654 | lines.append("mod detail {") |
| 1655 | lines.append(" use super::*;") |
| 1656 | lines.append("") |
| 1657 | lines.append(" pub(super) fn get_fory() -> &'static ::fory::Fory {") |
| 1658 | lines.append( |
| 1659 | " static FORY: ::std::sync::OnceLock<::fory::Fory> = ::std::sync::OnceLock::new();" |
| 1660 | ) |
| 1661 | lines.append(" FORY.get_or_init(|| {") |
| 1662 | lines.append(" let mut fory = ::fory::Fory::builder()") |
| 1663 | lines.append(" .xlang(true)") |
| 1664 | lines.append(" .track_ref(true)") |
| 1665 | lines.append(" .compatible(true)") |
| 1666 | lines.append(" .build();") |
| 1667 | for module in self._collect_imported_modules(): |
| 1668 | lines.append( |
| 1669 | f' crate::{module}::register_types(&mut fory).expect("failed to register fory types");' |
| 1670 | ) |
| 1671 | lines.append( |
| 1672 | ' register_types(&mut fory).expect("failed to register fory types");' |
| 1673 | ) |
| 1674 | lines.append(" fory") |
| 1675 | lines.append(" })") |
| 1676 | lines.append(" }") |
| 1677 | lines.append("}") |
| 1678 | return lines |
| 1679 | |
| 1680 | def generate_enum_registration( |
| 1681 | self, |
no test coverage detected