// The README includes doctests requiring these features. To make sure that // tests pass when not all features are provided we exclude it when the // required features are not available. #![cfg_attr(
all(
feature = "add",
feature = "display",
feature = "from",
feature = "into"
),
doc = include_str!("../README.md")
)] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(all(not(feature = "std"), feature = "error"), feature(error_in_core))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(any(not(docsrs), ci), deny(rustdoc::all))] #![forbid(non_ascii_idents, unsafe_code)] #![warn(clippy::nonstandard_macro_braces)]
// Not public, but exported API. For macro expansion internals only. #[doc(hidden)] pubmod __private { #[cfg(feature = "debug")] pubusecrate::fmt::{debug_tuple, DebugTuple};
// The modules containing error types and other helpers #[cfg(any(feature = "add", feature = "not"))] pubmod ops;
#[cfg(feature = "debug")] mod fmt;
#[cfg(feature = "error")] mod vendor;
#[cfg(feature = "from_str")] mod r#str; #[cfg(feature = "from_str")] #[doc(inline)] pubusecrate::r#str::FromStrError;
#[cfg(feature = "try_into")] mod convert; #[cfg(feature = "try_into")] #[doc(inline)] pubusecrate::convert::TryIntoError;
#[cfg(feature = "try_unwrap")] mod try_unwrap; #[cfg(feature = "try_unwrap")] #[doc(inline)] pubuseself::try_unwrap::TryUnwrapError;
// When re-exporting traits from std we need to do a pretty crazy trick, because we ONLY want // to re-export the traits and not derives that are called the same in the std module, // because those would conflict with our own. The way we do this is by first importing both // the trait and possible derive into a separate module and re-export them. Then we wildcard import // all the things from that module into the main module, but we also import our own derive by its // exact name. Due to the way wildcard imports work in rust, that results in our own derive taking // precedence over any derive from std. For some reason the named re-export of our own derive // cannot be in in this (or really any) macro too. It will somehow still consider it a wildcard // then and will result in this warning ambiguous_glob_reexports, and not actually exporting of our // derive.
macro_rules! re_export_traits((
$feature:literal, $new_module_name:ident, $module:path $(, $traits:ident)* $(,)?) => { #[cfg(feature = $feature)] mod $new_module_name { pubuse $module::{$($traits),*};
}
// Now re-export our own derives by their exact name to overwrite any derives that the trait // re-exporting might inadvertently pull into scope. #[cfg(feature = "add")] pubuse derive_more_impl::{Add, BitAnd, BitOr, BitXor, Sub};
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.