MCPcopy Index your code
hub / github.com/RustPython/RustPython / new_inner

Method new_inner

crates/vm/src/stdlib/time.rs:889–909  ·  view source on GitHub ↗
(
            vm: &VirtualMachine,
            tm: NaiveDateTime,
            isdst: i32,
            gmtoff: i32,
            zone: &str,
        )

Source from the content-addressed store, hash-verified

887 impl StructTimeData {
888 #[cfg(not(any(unix, windows)))]
889 fn new_inner(
890 vm: &VirtualMachine,
891 tm: NaiveDateTime,
892 isdst: i32,
893 gmtoff: i32,
894 zone: &str,
895 ) -> Self {
896 Self {
897 tm_year: vm.ctx.new_int(tm.year()).into(),
898 tm_mon: vm.ctx.new_int(tm.month()).into(),
899 tm_mday: vm.ctx.new_int(tm.day()).into(),
900 tm_hour: vm.ctx.new_int(tm.hour()).into(),
901 tm_min: vm.ctx.new_int(tm.minute()).into(),
902 tm_sec: vm.ctx.new_int(tm.second()).into(),
903 tm_wday: vm.ctx.new_int(tm.weekday().num_days_from_monday()).into(),
904 tm_yday: vm.ctx.new_int(tm.ordinal()).into(),
905 tm_isdst: vm.ctx.new_int(isdst).into(),
906 tm_zone: vm.ctx.new_str(zone).into(),
907 tm_gmtoff: vm.ctx.new_int(gmtoff).into(),
908 }
909 }
910
911 /// Create struct_time for UTC (gmtime)
912 #[cfg(not(any(unix, windows)))]

Callers

nothing calls this directly

Calls 9

monthMethod · 0.80
dayMethod · 0.80
new_intMethod · 0.45
yearMethod · 0.45
hourMethod · 0.45
minuteMethod · 0.45
secondMethod · 0.45
weekdayMethod · 0.45
new_strMethod · 0.45

Tested by

no test coverage detected