Trait Bounded

Source
pub trait Bounded: Sized + PartialOrd {
    // Required methods
    fn maximum() -> Self;
    fn minimum() -> Self;

    // Provided methods
    fn is_maximum(&self) -> bool { ... }
    fn is_minimum(&self) -> bool { ... }
    fn set_maximum(&mut self) { ... }
    fn set_minimum(&mut self) { ... }
}
Expand description

Trait for max/min bounds

Required Methods§

Source

fn maximum() -> Self

Source

fn minimum() -> Self

Provided Methods§

Source

fn is_maximum(&self) -> bool

Examples found in repository?
crates/aizu_online_judge/src/grl/grl_1_a.rs (line 16)
10pub fn grl_1_a(reader: impl Read, mut writer: impl Write) {
11    let s = read_all_unchecked(reader);
12    let mut scanner = Scanner::new(&s);
13    scan!(scanner, vs, es, r, (graph, d): @DirectedGraphScanner::<usize, u64>::new(vs, es));
14    let cost = graph.dijkstra_ss::<StandardSp<AdditiveOperation<_>>, _>(r, &d);
15    for u in graph.vertices() {
16        if cost[u].is_maximum() {
17            writeln!(writer, "INF").ok();
18        } else {
19            writeln!(writer, "{}", cost[u]).ok();
20        }
21    }
22}
Source

fn is_minimum(&self) -> bool

Source

fn set_maximum(&mut self)

Source

fn set_minimum(&mut self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Bounded for bool

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for f32

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for f64

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for i8

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for i16

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for i32

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for i64

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for i128

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for isize

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for u8

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for u16

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for u32

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for u64

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for u128

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for ()

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl Bounded for usize

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded> Bounded for (A,)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded> Bounded for (A, B)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded> Bounded for (A, B, C)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded, D: Bounded> Bounded for (A, B, C, D)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded, D: Bounded, E: Bounded> Bounded for (A, B, C, D, E)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded, D: Bounded, E: Bounded, F: Bounded> Bounded for (A, B, C, D, E, F)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded, D: Bounded, E: Bounded, F: Bounded, G: Bounded> Bounded for (A, B, C, D, E, F, G)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded, D: Bounded, E: Bounded, F: Bounded, G: Bounded, H: Bounded> Bounded for (A, B, C, D, E, F, G, H)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded, D: Bounded, E: Bounded, F: Bounded, G: Bounded, H: Bounded, I: Bounded> Bounded for (A, B, C, D, E, F, G, H, I)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<A: Bounded, B: Bounded, C: Bounded, D: Bounded, E: Bounded, F: Bounded, G: Bounded, H: Bounded, I: Bounded, J: Bounded> Bounded for (A, B, C, D, E, F, G, H, I, J)

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<T> Bounded for Option<T>
where T: Bounded,

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Source§

impl<T> Bounded for Reverse<T>
where T: Bounded,

Source§

fn maximum() -> Self

Source§

fn minimum() -> Self

Implementors§