本文簡要介紹rust語言中 std::ops::Not.not
的用法。
用法
fn not(self) -> Self::Output
執行一元 !
操作。
例子
assert_eq!(!true, false);
assert_eq!(!false, true);
assert_eq!(!1u8, 254);
assert_eq!(!0u8, 255);
相關用法
- Rust Not用法及代碼示例
- Rust NonZeroU128.checked_pow用法及代碼示例
- Rust NonZeroUsize.checked_next_power_of_two用法及代碼示例
- Rust NonZeroI128.saturating_pow用法及代碼示例
- Rust NonZeroI64.wrapping_abs用法及代碼示例
- Rust NonZeroU64.checked_mul用法及代碼示例
- Rust NonZeroU16.saturating_pow用法及代碼示例
- Rust NonZeroU8.checked_add用法及代碼示例
- Rust NonZeroUsize.checked_pow用法及代碼示例
- Rust NonZeroU8.unchecked_add用法及代碼示例
- Rust NonZeroUsize.leading_zeros用法及代碼示例
- Rust NonZeroI32.trailing_zeros用法及代碼示例
- Rust NonZeroI8.saturating_pow用法及代碼示例
- Rust NonZeroIsize.wrapping_abs用法及代碼示例
- Rust NonZeroU128.leading_zeros用法及代碼示例
- Rust NonZeroU16.checked_pow用法及代碼示例
- Rust NonZeroI16.saturating_abs用法及代碼示例
- Rust NonZeroI16.leading_zeros用法及代碼示例
- Rust NonZeroU32.checked_mul用法及代碼示例
- Rust NonZeroI8.unchecked_mul用法及代碼示例
- Rust NonZeroU16.trailing_zeros用法及代碼示例
- Rust NonZeroIsize.checked_mul用法及代碼示例
- Rust NonZeroI64.saturating_pow用法及代碼示例
- Rust NonZeroUsize.checked_mul用法及代碼示例
- Rust NonZeroI128.abs用法及代碼示例
注:本文由純淨天空篩選整理自rust-lang.org大神的英文原創作品 std::ops::Not.not。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。