is_[condition]: Boolean Check
Check a condition about a datatype.
// Copyright 2025 Google LLC
// SPDX-License-Identifier: Apache-2.0
impl<T> Vec<T> {
fn is_empty(&self) -> bool;
}
impl f32 {
fn is_nan(self) -> bool;
}
impl u32 {
fn is_power_of_two(self) -> bool;
}
-
A boolean condition on a value.
-
isprefix is preferred over methods withnotin the name. There are no instances ofis_not_in standard library methods, just use!value.is_[condition].