/// Creates an `Integer`, panicking if the value is out of range. /// /// This method is intended to be called from `const` contexts in which the /// value is known to be valid. Use [`TryFrom::try_from`] for non-panicking /// conversions. #[must_use] pubconstfn constant(v: i64) -> Self { if v >= Self::MIN.0 && v <= Self::MAX.0 { Self(v)
} else {
panic!("out of range for Integer")
}
}
}
impl_conversions! {
i8: From => TryInto,
i16: From => TryInto,
i32: From => TryInto,
i64: TryFrom => Into,
i128: TryFrom => Into,
isize: TryFrom => TryInto,
u8: From => TryInto,
u16: From => TryInto,
u32: From => TryInto,
u64: TryFrom => TryInto,
u128: TryFrom => TryInto,
usize: TryFrom => TryInto,
}
/// Creates an `Integer`, panicking if the value is out of range. /// /// This is a convenience free function for [`Integer::constant`]. /// /// This method is intended to be called from `const` contexts in which the /// value is known to be valid. Use [`TryFrom::try_from`] for non-panicking /// conversions. #[must_use] pubconstfn integer(v: i64) -> Integer {
Integer::constant(v)
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.