Skip to main content

Successor

Trait Successor 

Source
pub trait Successor {
    // Provided method
    fn successor(&self) -> Option<Self>
       where Self: Sized { ... }
}
Expand description

A successor is a term that comes right after a particular value. Suppose n is a number (where n belongs to any whole number), then the successor of n is ‘n+1’. The other terminologies used for a successor are just after, immediately after, and next value.

Provided Methods§

Source

fn successor(&self) -> Option<Self>
where Self: Sized,

Returns the successor of the current value if it exists, otherwise returns None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Successor for i16

Source§

fn successor(&self) -> Option<Self>

Source§

impl Successor for i32

Source§

fn successor(&self) -> Option<Self>

Source§

impl Successor for i64

Source§

fn successor(&self) -> Option<Self>

Implementors§