devela::all

Macro const_assert

Source
macro_rules! const_assert {
    (
        // Asserts that a single expression evaluates to `true`.
        $x:expr $(,)?) => { ... };
    (
        // Asserts that constants are equal in value.
        eq $x:expr, $($y:expr),+ $(,)?) => { ... };
    (
        // Asserts that byte slice buffers are equal in value.
        eq_buf $buf:expr, $($other:expr),+ $(,)?) => { ... };
    (
        // Asserts that string slices are equal in value.
        eq_str $str:expr, $($other:expr),+ $(,)?) => { ... };
    (
        // Asserts that constants of type `usize` are equal in value.
        // (Allows for inspecting the values in error messages).
        eq_usize $x:expr, $($y:expr),+ $(,)?) => { ... };
    (
        // Asserts that constants are not equal in value.
        ne $x:expr, $($y:expr),+ $(,)?) => { ... };
    (
        // Asserts that constants are less than each other.
        lt $x:expr, $($y:expr),+ $(,)?) => { ... };
    (
        // Asserts that constants are less than or equal to each other.
        le $x:expr, $($y:expr),+ $(,)?) => { ... };
    (
        // Asserts that constants are greater than each other.
        gt $x:expr, $($y:expr),+ $(,)?) => { ... };
    (
        // Asserts that constants are greater than or equal to each other.
        ge $x:expr, $($y:expr),+ $(,)?) => { ... };
    (
    /* private arms*/

        @build $x:expr, $($y:expr),+; $op:tt) => { ... };
    (
        @build $x:expr; $op:tt) => { ... };
}
Expand description

Asserts various comparisons on constants.